ServeMyAPI

by jktfe

10 stars
Not rated
GitHub

About

Securely stores and retrieves API keys using macOS Keychain, allowing natural language access to credentials without exposing them in .env files

Details

Author
jktfe
GitHub stars
10
Categories
Developer Tools, API, Security, Other, AI, Design, File Management, Infrastructure

- 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

npm install

npm run build
npm link

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

npm start

For applications that require HTTP access:

node dist/server.js

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

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

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 guidelinesbefore 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

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

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

- .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

- 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

- 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.

- 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

# Clone the repository git clone https://github.com/yourusername/servemyapi.git cd servemyapi # Install dependencies npm install # Build the project npm run build

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

# 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

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

For applications that require HTTP access:

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

DO NOT USE THE SMITHERY HOSTED VERSIONfor storing real API keys. The Smithery deployment exists for demonstration purposes only. Using it would:
- Transmit your API keys over the internet(even with HTTPS, this violates the principle of keeping keys local)
- Store your keys on someone else's server(the Smithery infrastructure)
- Potentially expose your keysto 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.

ServeMyAPI works with any MCP-compatible client. Example configuration files are provided in theexamplesdirectory.
-

Locate or create the Claude Desktop configuration file:

- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:%AppData%\Claude\claude_desktop_config.json

Add ServeMyAPI to themcpServerssection (you can copy fromexamples/claude_desktop_config.json):

{ "mcpServers": { "serveMyAPI": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/servemyapi/dist/index.js" ] } } }

Replace/ABSOLUTE/PATH/TO/servemyapiwith the actual path to your ServeMyAPI installation.
- Open Windsurf editor and navigate to Settings
- Add ServeMyAPI to your MCP server configuration using the example inexamples/windsurf_config.json
- Adapt the paths to your local installation

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

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

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

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

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

Using serveMyAPI, delete the API key named "OpenAI API Key"
Using serveMyAPI, list all my stored API keys

ServeMyAPI automatically selects the best storage provider for your platform:

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

You can override the automatic detection:

# Force a specific storage type export SERVEMYAPI_STORAGE_TYPE=file # or 'keychain', 'memory' # Configure file storage location export STORAGE_DIR=/path/to/secure/directory

- Native OS-level security
- No encryption needed
- Requires user permission on first use

- AES-256-GCM encryption
- PBKDF2 key derivation
- Stores in~/.servemyapi/keys.json.encby default
- RequiresENCRYPTION_KEYenvironment variable

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

- 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

# 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"
Authorization: Bearer your-secure-api-key

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

For detailed security configuration, seedocs/SECURITY.md.

-

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.

# 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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Enterprise-grade authentication with secure credential management, multi-protocol support, and real-time threat detection.

Official managed MCP server for the Cycode platform. Exposes projects, violations, compliance frameworks, audit logs, brokers, SBOM, and more via OAuth-authenticated remote access — no local install required.

A secure MCP gateway that acts as a proxy, providing authentication, tool discovery, caching, and guardrail enforcement.

Performs data enrichment on observables using third-party services via the security-cli Python package.

Hosted OAuth 2.1 + Dynamic Client Registration (RFC 7591) for MCP servers

Scan projects for over 500 types of secrets using GitGuardian's API to prevent credential leaks.

A FastAPI microservice for health-related operations, featuring JWT authentication and a PostgreSQL database with Alembic migrations.

Hosted Streamable HTTP MCP server for IP intelligence, fraud risk scoring, email validation, DNS, WHOIS, domain age, quota, and usage tools for AI agents.

GeoIP and ASN intelligence for AI agents with country, city, timezone, network ownership and ASN lookups.

An MCP server for Keycloak administration, offering over 30 tools to manage users, realms, clients, roles, and more from AI assistants.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.