ServeMyAPI is a personal MCP (Model Context Protocol) server that lets you securely store and access API keys across multiple projects using the macOS Keychain. It provides a consistent interface for storing credentials that can be accessed through natural language when used with LLMs like Claude.
# Clone the repository
git clone https://github.com/yourusername/servemyapi.git
cd servemyapi
# Install dependencies
npm install
# Build the project
npm run build
This is the simplest way to use ServeMyAPI with Claude Desktop:
npm start
For applications requiring HTTP access:
node dist/server.js
This starts the server on port 3000 (or the port specified in the PORT environment variable).
ServeMyAPI includes a command-line interface for key management:
# Install the CLI globally
npm run build
npm link
# List all stored API keys
api-key list
# Get a specific API key
api-key get github_token
# Store a new API key
api-key store github_token ghp_123456789abcdefg
# Delete an API key
api-key delete github_token
# Display help
api-key help
To connect ServeMyAPI with Claude Desktop:
Find or create the Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
Add ServeMyAPI to the mcpServers
section:
{
"mcpServers": {
"serveMyAPI": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/servemyapi/dist/index.js"
]
}
}
}
Replace /ABSOLUTE/PATH/TO/servemyapi
with your actual installation path
Restart Claude Desktop
ServeMyAPI is available as a hosted service on Smithery:
import { createTransport } from "@smithery/sdk/transport.js"
const transport = createTransport("https://server.smithery.ai/@Jktfe/servemyapi")
// Create MCP client
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
const client = new Client({
name: "Test client",
version: "1.0.0"
})
await client.connect(transport)
// Use the server tools with your LLM application
const tools = await client.listTools()
console.log(`Available tools: ${tools.map(t => t.name).join(", ")}`)
Stores an API key in the keychain.
Parameters:
name
: The name/identifier for the API keykey
: The API key to storeExample (from Claude):
Using serveMyAPI, store my API key ABC123XYZ as "OpenAI API Key"
Retrieves an API key from the keychain.
Parameters:
name
: The name/identifier of the API key to retrieveExample (from Claude):
Using serveMyAPI, get the API key named "OpenAI API Key"
Deletes an API key from the keychain.
Parameters:
name
: The name/identifier of the API key to deleteExample (from Claude):
Using serveMyAPI, delete the API key named "OpenAI API Key"
Lists all stored API keys.
No parameters required.
Example (from Claude):
Using serveMyAPI, list all my stored API keys
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.