New MCP Server — Remote & Local

MCP Server

Connect Clavis to Claude as an MCP server. Choose between a remote OAuth 2.1 endpoint (no install required) or the local stdio npm package for Claude Desktop.

What is MCP?

The Model Context Protocol (MCP) is an open standard developed by Anthropic that allows AI assistants like Claude to securely connect to external tools and data sources. Instead of embedding credentials or writing custom API calls, you expose a set of tools that Claude can call on your behalf.

MCP servers can run locally on your machine (communicating over stdio) or remotely over HTTPS using the Streamable HTTP transport. Clavis supports both modes — the same four tools are available either way.

Open standard: MCP is not Claude-specific. Any MCP-compatible client can connect to the Clavis MCP server, including Claude Desktop, Claude.ai, and third-party agents that implement the protocol. The Clavis MCP server is built to the MCP specification's technical requirements for Streamable HTTP transport and OAuth 2.1 authentication.

Two Ways to Connect

  Remote endpoint Local stdio (npm)
URL / command https://clavisagent.com/mcp npx @clavisagent/mcp-server
Transport Streamable HTTP stdio
Authentication OAuth 2.1 (authorization-code + PKCE) Static JWT in config file
Install required None Node.js 18+ and npm
Best for Claude.ai and any Streamable HTTP MCP client Claude Desktop (local development)
🌐

Remote Endpoint (OAuth 2.1)

No install. Authenticate once with OAuth 2.1 and connect from any Streamable HTTP MCP client.

The remote MCP endpoint is a Streamable HTTP server hosted at:

MCP endpoint URL
https://clavisagent.com/mcp

It is protected by OAuth 2.1 using the authorization-code flow with PKCE. MCP clients that support OAuth 2.1 discovery handle the login flow automatically — they read the server metadata and redirect you to authorize. You do not manually paste tokens.

OAuth 2.1 discovery

The server publishes standard discovery documents that compliant clients use automatically:

Authorization server metadata (RFC 8414)
GET https://clavisagent.com/.well-known/oauth-authorization-server
Protected resource metadata (RFC 9728)
GET https://clavisagent.com/.well-known/oauth-protected-resource

Any MCP client that implements OAuth 2.1 discovery per the MCP specification will find and use these automatically. No manual configuration of token or authorize endpoints is needed.

Connecting a client

For clients that support remote MCP connections with OAuth 2.1 (such as Claude.ai):

  1. In your MCP client settings, add a new remote server.
  2. Enter the URL: https://clavisagent.com/mcp
  3. Your client will redirect you to Clavis to authorize — log in with your Clavis account.
  4. After authorizing, the client holds an access token and can call all four tools immediately.
Token lifetime: Clavis access tokens expire after 24 hours. MCP clients that support token refresh will renew automatically. If your client does not, re-authorize by removing and re-adding the server.

Manual / programmatic access

If you are building a custom agent or script that calls the MCP endpoint directly, authenticate the same way as the REST API — obtain a JWT from POST /v1/auth/login and pass it as a Bearer token:

shell — direct call example
TOKEN=$(curl -sX POST https://clavisagent.com/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","password":"yourpassword"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")

curl -X POST https://clavisagent.com/mcp \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
🖥️

Local stdio Package (Claude Desktop)

Install once via npm. Best for local development with Claude Desktop.

The local path runs the MCP server as a child process on your machine via npx. Claude Desktop launches it and communicates over stdio. Your Clavis JWT goes in the config file rather than through an OAuth flow.

Requirements

No separate install step is required — Claude Desktop fetches and runs the latest version via npx automatically.

Requirements: Node.js 18+ and npm. You also need a Clavis account with at least one service registered. See the quickstart if you have not set one up yet.

Configuration

Add the Clavis MCP server to your Claude Desktop configuration file. The file location depends on your OS:

Add the following entry to the mcpServers section. If the file does not exist yet, create it with this structure:

claude_desktop_config.json
{
  "mcpServers": {
    "clavis": {
      "command": "npx",
      "args": ["-y", "@clavisagent/mcp-server"],
      "env": {
        "CLAVIS_API_KEY": "eyJ...",  // JWT from POST /v1/auth/login
        "CLAVIS_API_URL": "https://clavisagent.com"
      }
    }
  }
}
Where do I get my API key? Register at clavisagent.com/register.html, then call POST /v1/auth/login to receive a JWT (starts with eyJ). Use that JWT — not the cla_… key shown at sign-up — as your CLAVIS_API_KEY.

After saving the config, restart Claude Desktop. You should see a hammer icon in the chat input bar indicating MCP tools are available.

Troubleshooting (local)

Claude Desktop does not show the Clavis tools

Fully quit and restart Claude Desktop after editing the config. Verify the JSON is valid (no trailing commas):

shell — macOS/Linux
$ node -e "JSON.parse(require('fs').readFileSync(process.argv[1],'utf8')) && console.log('valid JSON')" \
  ~/Library/Application\ Support/Claude/claude_desktop_config.json

Authentication errors

If Claude reports authentication failures, your JWT may have expired (default TTL is 24 hours). Fetch a fresh token and update the config:

shell
$ curl -sX POST https://clavisagent.com/v1/auth/login \
    -H 'Content-Type: application/json' \
    -d '{"email":"you@example.com","password":"yourpassword"}' \
  | python3 -m json.tool

npx fails or times out

Verify Node.js 18+ is installed and your network can reach the npm registry. You can also pre-cache the package:

shell
$ npm install -g @clavisagent/mcp-server

Then update the config to "command": "clavis-mcp", "args": [] instead of using npx.

Available Tools

The same four tools are available regardless of which connection mode you use:

Tool Description Parameters
list_services Returns all services registered in your Clavis account — name, connector type, and auth method. None
get_credentials Retrieves a valid, decrypted access token for the named service. Handles token refresh automatically if the cached token is expired. service_name (string) — the name you gave the service when registering it (e.g., "my-openai")
check_credential_status Checks whether a service's credentials are valid and returns rate-limit status (remaining requests, reset time). service_name (string)
call_service Recommended Makes an API call with server-side credential injection. The credential is fetched from the Clavis vault and injected into the upstream request — Claude never sees the raw key. Prevents prompt-injection exfiltration architecturally. service_name, method, url (required); headers, params, json, data (optional)
Security tip: Use call_service instead of get_credentials wherever possible. call_service injects the credential server-side — it never appears in the conversation, eliminating prompt-injection exfiltration as an attack vector.

Example Usage

Once connected (via either mode), you can interact with your Clavis credentials using plain English:

👤
You
What services do I have registered in Clavis?
Claude
I'll check your Clavis services now. [calls list_services]

You have 3 services registered:
my-openai — openai connector (api_key)
my-github — github connector (oauth2)
stripe-prod — stripe connector (api_key)
👤
You
Check my Stripe balance.
Claude
[calls call_service with service_name: "stripe-prod", method: "GET", url: "https://api.stripe.com/v1/balance"]

Your Stripe balance:
• Available: $4,231.00 USD
• Pending: $182.50 USD

The API key was injected server-side — it was never part of this conversation.
👤
You
Is my Stripe integration still working? Check the credential status.
Claude
[calls check_credential_status with service_name: "stripe-prod"]

Your stripe-prod service looks healthy:
• Status: valid
• Requests remaining: 847 / 1000 this window
• Window resets in: 34 minutes

NPM Package

The local stdio package is published on npm. Inspect the source, report issues, and track releases on the package page:

Next Steps