ServeMyAPI logo

ServeMyAPI

Community
Jktfe

A personal MCP (Model Context Protocol) server for securely storing and accessing API keys across projects using the macOS Keychain.

PublisherJktfe
RepositoryserveMyAPI
LanguageTypeScript
Forks
6
Stars
25
Available tools
0
Transport typestdio, streamable-http
Categories
Links
  • Connect tools to AI workflows

    ServeMyAPI exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    25 stars and 6 forks from the linked repository.

ServeMyAPI

smithery badge

A personal MCP (Model Context Protocol) server for securely storing and accessing API keys across projects using the macOS Keychain.

🔒 SECURITY FIRST: ServeMyAPI is designed to run LOCALLY on your machine. API keys are NEVER transmitted over the internet and should NEVER be deployed to cloud services. Read the critical security guidelines before using.

Cross-Platform Support: ServeMyAPI now includes a storage abstraction layer that enables support for multiple platforms:

  • macOS: Uses the native Keychain (default)
  • Windows/Linux: Uses encrypted file storage
  • Docker: Automatically uses encrypted file storage
  • Memory: Available for testing and temporary storage

Overview

ServeMyAPI allows you to store API keys securely in the macOS Keychain and access them through a consistent MCP interface. This makes it easy to:

  • Store API keys securely (they're never visible in .env files or config files)
  • Access the same keys across multiple projects
  • Use natural language to store and retrieve keys (when used with LLMs like Claude)
  • Provide keys directly to your AI assistant when it needs to access services

Why ServeMyAPI over .ENV Files?

Using ServeMyAPI instead of traditional .ENV files solves several common problems:

  1. GitHub Security Conflicts:

    • .ENV files need to be excluded from Git repositories for security (via .gitignore)
    • This creates a "hidden context" problem where important configuration is invisible to collaborators and LLMs
    • New developers often struggle with setting up the correct environment variables
  2. LLM Integration Challenges:

    • LLMs like Claude can't directly access your .ENV files due to security constraints
    • When LLMs need API keys to complete tasks, you often need manual workarounds
    • ServeMyAPI lets your AI assistant request keys through natural language
  3. Cross-Project Consistency:

    • With .ENV files, you typically need to duplicate API keys across multiple projects
    • When keys change, you need to update multiple files
    • ServeMyAPI provides a central storage location accessible from any project

This approach gives you the best of both worlds: secure storage of sensitive credentials without sacrificing visibility and accessibility for your AI tools.

Features

  • Secure storage of API keys in the macOS Keychain
  • Simple MCP tools for storing, retrieving, listing, and deleting keys
  • Convenient CLI interface for terminal-based key management
  • Support for both stdio and HTTP/SSE transports (with authentication)
  • Compatible with any MCP client (Claude Desktop, etc.)
  • Enhanced Security Features:
    • Input validation to prevent path traversal attacks
    • Encrypted file storage for Docker deployments
    • Bearer token authentication for HTTP endpoints
    • Rate limiting and session management
    • Security headers and CORS protection
    • Secure logging with automatic redaction of sensitive data

Installation

bash
# Clone the repository
git clone https://github.com/yourusername/servemyapi.git
cd servemyapi

# Install dependencies
npm install

# Build the project
npm run build

Usage

CLI Interface

ServeMyAPI comes with a command-line interface for quick key management directly from your terminal:

bash
# 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

Running as a stdio server

This is the simplest way to use ServeMyAPI as an MCP server, especially when working with Claude Desktop:

bash
npm start

Running as an HTTP server

For applications that require HTTP access:

bash
node dist/server.js

This will start the server on port 3000 (or the port specified in the PORT environment variable).

⚠️ IMPORTANT SECURITY WARNING

DO NOT USE THE SMITHERY HOSTED VERSION for storing real API keys. The Smithery deployment exists for demonstration purposes only. Using it would:

  1. Transmit your API keys over the internet (even with HTTPS, this violates the principle of keeping keys local)
  2. Store your keys on someone else's server (the Smithery infrastructure)
  3. Potentially expose your keys to the service operator or in case of a breach

ServeMyAPI is designed to run LOCALLY on your machine only. The entire security model depends on keys never leaving your local environment.

Configuring MCP Clients

ServeMyAPI works with any MCP-compatible client. Example configuration files are provided in the examples directory.

Claude Desktop

To use ServeMyAPI with Claude Desktop:

  1. Locate or create the Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %AppData%\Claude\claude_desktop_config.json
  2. Add ServeMyAPI to the mcpServers section (you can copy from examples/claude_desktop_config.json):

    json
    {
      "mcpServers": {
        "serveMyAPI": {
          "command": "node",
          "args": [
            "/ABSOLUTE/PATH/TO/servemyapi/dist/index.js"
          ]
        }
      }
    }
  3. Replace /ABSOLUTE/PATH/TO/servemyapi with the actual path to your ServeMyAPI installation.

  4. Restart Claude Desktop.

Windsurf

To use ServeMyAPI with Windsurf:

  1. Open Windsurf editor and navigate to Settings
  2. Add ServeMyAPI to your MCP server configuration using the example in examples/windsurf_config.json
  3. Adapt the paths to your local installation

MCP Tools

ServeMyAPI exposes the following tools:

store-api-key

Store an API key in the keychain.

Parameters:

  • name: The name/identifier for the API key
  • key: The API key to store

Example (from Claude):

Using serveMyAPI, store my API key ABC123XYZ as "OpenAI API Key"

get-api-key

Retrieve an API key from the keychain.

Parameters:

  • name: The name/identifier of the API key to retrieve

Example (from Claude):

Using serveMyAPI, get the API key named "OpenAI API Key"

delete-api-key

Delete an API key from the keychain.

Parameters:

  • name: The name/identifier of the API key to delete

Example (from Claude):

Using serveMyAPI, delete the API key named "OpenAI API Key"

list-api-keys

List all stored API keys.

No parameters required.

Example (from Claude):

Using serveMyAPI, list all my stored API keys

Storage Options

ServeMyAPI automatically selects the best storage provider for your platform:

Platform Detection

  • macOS: Keychain (default)
  • Windows: Encrypted file storage
  • Linux: Encrypted file storage
  • Docker: Encrypted file storage

Manual Configuration

You can override the automatic detection:

bash
# Force a specific storage type
export SERVEMYAPI_STORAGE_TYPE=file  # or 'keychain', 'memory'

# Configure file storage location
export STORAGE_DIR=/path/to/secure/directory

Storage Types

  1. Keychain Storage (macOS only)

    • Native OS-level security
    • No encryption needed
    • Requires user permission on first use
  2. File Storage (Cross-platform)

    • AES-256-GCM encryption
    • PBKDF2 key derivation
    • Stores in ~/.servemyapi/keys.json.enc by default
    • Requires ENCRYPTION_KEY environment variable
  3. Memory Storage (Testing)

    • In-memory only
    • Data lost on restart
    • Useful for testing and development

Security

Core Security Features

  • Platform-Aware Storage: Automatically selects secure storage for each platform
  • macOS Keychain Storage: API keys are stored in the macOS Keychain with native OS-level security
  • Encrypted File Storage: Cross-platform support with AES-256-GCM encryption
  • Docker Encryption: When running in Docker, keys are encrypted using AES-256-GCM with PBKDF2 key derivation
  • Authentication: HTTP/SSE endpoints require Bearer token authentication
  • Input Validation: Strict validation prevents path traversal and injection attacks
  • Rate Limiting: Protects against abuse with configurable request limits
  • Secure Logging: Automatic redaction of sensitive data in all log outputs

HTTP Server Security

When using the HTTP/SSE transport:

bash
# Set authentication key
export SERVEAPI_AUTH_KEY="your-secure-api-key"

# Set encryption key for Docker
export ENCRYPTION_KEY="your-encryption-key"

# Configure CORS origins
export ALLOWED_ORIGINS="https://app1.com,https://app2.com"

Include the Bearer token in requests:

Authorization: Bearer your-secure-api-key

Best Practices

  1. Always use HTTPS in production - Deploy behind a reverse proxy with TLS
  2. Set strong authentication keys - Use openssl rand -base64 32 to generate
  3. Run as non-root - The Docker image automatically uses a restricted user
  4. Regular key rotation - Periodically update your authentication and encryption keys
  5. Monitor access logs - Watch for suspicious patterns or unauthorized attempts

For detailed security configuration, see docs/SECURITY.md.

Roadmap

Future plans for ServeMyAPI include:

  • Code Scanner Tool: A tool that automatically scans your codebase for API endpoints, sensitive URLs, and environment variables, then suggests names to store them in the Keychain. This would allow developers to continue using .ENV files in their regular workflow while ensuring credentials are also available to LLMs and other tools when needed.

  • Cross-Platform Support: Investigating secure credential storage options for Windows and Linux to make ServeMyAPI more widely accessible.

  • Integration with Popular Frameworks: Providing easy integration with frameworks like Next.js, Express, and others.

  • UI for Key Management: A simple web interface for managing your stored API keys directly.

Feel free to suggest additional features or contribute to the roadmap by opening an issue or pull request.

Development

bash
# Run in development mode with hot reload
npm run dev

# Use the CLI during development
npm run cli list

# Lint the code
npm run lint

# Build for production
npm run build

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "servemyapi": {
      "command": "npx",
      "args": [
        "servemyapi"
      ]
    }
  }
}

Use ServeMyAPI MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once ServeMyAPI is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add ServeMyAPI as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the ServeMyAPI MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "servemyapi": {
      "command": "npx",
      "args": [
        "-y",
        "servemyapi"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the ServeMyAPI MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the ServeMyAPI MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use ServeMyAPI to help me with this task?
ServeMyAPI
Sure. I read it.
Here is what I found using ServeMyAPI.

Option 2: Add an MCP server URL

Use this when ServeMyAPI is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for ServeMyAPI.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the ServeMyAPI connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the ServeMyAPI tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the ServeMyAPI tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use ServeMyAPI to help me with this task?
ServeMyAPI
Sure. I read it.
Here is what I found using ServeMyAPI.

Frequently asked questions

What is the ServeMyAPI MCP server used for?

ServeMyAPI is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use ServeMyAPI MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use ServeMyAPI with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use ServeMyAPI MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With ServeMyAPI connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect ServeMyAPI MCP to TypingMind?

ServeMyAPI can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does ServeMyAPI MCP provide in TypingMind?

ServeMyAPI exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use ServeMyAPI MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If ServeMyAPI requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇