api
lightweight API MCP server
claude mcp add --transport stdio adamshannag-api-mcp-server api-mcp-server --transport stdio --config ./config.json \ --env LOG_LEVEL="Sets the minimum logging level (DEBUG, INFO, WARN, ERROR)" \ --env API_MCP_HOST="SSE host to bind to" \ --env API_MCP_PORT="SSE port to bind to" \ --env API_MCP_SSE_API_KEY="Optional Bearer token for auth"
How to use
This MCP server provides a lightweight interface for executing defined API tools via the MCP protocol. It supports dynamic HTTP requests with typed arguments, and can operate over multiple transports, including stdio (default) and SSE. To use it, first configure one or more tools in a JSON tool configuration file describing the target host, HTTP method, endpoints, and the arguments expected from the language model. Run the server with the desired transport and point it at your tool configuration. The server will expose these tools to clients via MCP, allowing you to invoke them with structured inputs and receive formatted responses. If you enable the SSE transport, you can optionally secure the endpoint with a Bearer token. The environment variable placeholders in the tool configuration support substituting values at runtime, ensuring safe and repeatable executions.
How to install
Prerequisites:
- Go installed to build from source or to install the binary via go install.
- Internet access to download dependencies if building.
Option A: Install via pre-built binary
- Download the latest release binary from the project's Releases page.
- Make it executable: chmod +x api-mcp-server
- Run with a sample config: ./api-mcp-server --transport stdio --config ./config.json
Option B: Build from source
- Ensure Go is installed (version 1.18+): go version
- Fetch and build the CLI: go install github.com/AdamShannag/api-mcp-server/cmd/api-mcp-server@v0.2.0
- Run the binary: api-mcp-server --transport stdio --config ./config.json
Configuration and runtime:
- Prepare a tool configuration JSON (config.json) as described in the repository README.
- Set necessary environment variables as described in the Environment Variables section if you rely on substitutions.
Additional notes
Tips and common considerations:
- If using the SSE transport, remember to set API_MCP_SSE_API_KEY to enable Bearer token authentication.
- The tool configuration supports environment variable substitution using the syntax {{env VAR_NAME:default_value}}. Use this to keep sensitive values out of the config file.
- Ensure the host and port are accessible from the runtime environment, especially when running behind firewalls or in containerized environments.
- The server supports multiple tools in a single config file; you can reuse the same host with different endpoints and argument sets.
- When troubleshooting, enable LOG_LEVEL=DEBUG to get verbose logs for request construction, header handling, and response parsing.
Related MCP Servers
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
github-brain
An experimental GitHub MCP server with local database.
mcp-tts
MCP Server for Text to Speech
tasker
An MCP server for Android's Tasker automation app.
chromedp
MCP server for browser automation using chromedp
mcp4go
A comprehensive Go SDK for the Model Context Protocol (MCP) - simplifying AI application development by abstracting away protocol complexities.