New MCP Server — Claude Desktop Integration

MCP Server

Use Clavis directly in Claude Desktop as a native MCP server. Manage credentials and query services with natural language.

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 run locally on your machine and communicate with Claude Desktop over a secure local socket. Your credentials never leave your computer — the MCP server talks to the Clavis API using your stored auth token.

Open standard: MCP is not Claude-specific. Any MCP-compatible client can connect to the Clavis MCP server. Claude Desktop is the most common client today.

Why use Clavis with Claude Desktop?

Clavis already manages your credentials for AI services like OpenAI, Anthropic, GitHub, Stripe, and more. The Clavis MCP server exposes that credential vault directly inside Claude Desktop — no copy-pasting API keys, no switching terminals.

Installation

The Clavis MCP server is distributed as an npm package. Install it globally so Claude Desktop can find the binary:

shellnpm ↗
$ npm install -g @clavisagent/mcp-server

Verify the installation:

shell
$ clavis-mcp --version
0.1.1
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 of your config. If the file does not exist yet, create it with the structure below:

claude_desktop_config.json
{
  "mcpServers": {
    "clavis": {
      "command": "clavis-mcp",
      "args": [],
      "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.

Available Tools

The Clavis MCP server exposes three tools to Claude:

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: calling an API securely with call_service

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.

Example Usage

Once the MCP server is running, you can interact with your Clavis credentials using plain English in Claude Desktop:

👤
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
Get my OpenAI credentials so I can test an API call.
Claude
Fetching your OpenAI token from Clavis. [calls get_credentials with service_name: "my-openai"]

Here is your current OpenAI API key: sk-proj-••••••••XYZ
Token is valid and cached — expires in 11h 42m.
👤
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

Troubleshooting

Claude Desktop does not show the Clavis tools

Make sure you have fully quit and restarted Claude Desktop after editing the config file. Also verify the config JSON is valid (no trailing commas). You can validate it with:

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:

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

Copy the new access_token value into your claude_desktop_config.json and restart Claude Desktop.

MCP server binary not found

Ensure clavis-mcp is on your PATH after the global install:

shell
$ which clavis-mcp
/usr/local/bin/clavis-mcp

If the command is not found, check that your npm global bin directory is in your PATH. Run npm bin -g to find the path and add it to your shell profile.

NPM Package

The Clavis MCP server is published on npm. You can inspect the source, report issues, and track releases on the package page:

Next Steps