A lightweight MCP server enabling dynamic HTTP tools with SSE/stdio transports.
Configuration
View docs{
"mcpServers": {
"adamshannag-api-mcp-server": {
"command": "api-mcp-server",
"args": [
"--transport",
"stdio",
"--config",
"./demo.tools.json"
],
"env": {
"LOG_LEVEL": "INFO",
"API_MCP_HOST": "127.0.0.1",
"API_MCP_PORT": "13080",
"API_MCP_SSE_API_KEY": "<optional_secret>"
}
}
}
}API MCP Server is a lightweight, extensible runtime for defining and executing API tools using the MCP protocol. It supports dynamic HTTP requests, typed arguments, and multiple transports, making it easy to compose tools that call external APIs and expose them through a uniform MCP interface.
You run the server locally and connect an MCP client to discover and invoke the defined tools. Tools are described in a configuration file and can perform HTTP requests with parameterized inputs. You can choose between a local process (stdio) or a remote transport (http/sse) depending on your deployment needs.
To start using the server with the built-in SSE transport, you can provide a tool configuration file and run the server with a command that enables SSE and points to your config. The server will listen for incoming MCP requests and route them to the configured tools.
Prerequisites depend on the language toolchain used to build or run the server. This guide shows a Go-based install method and an option to download a pre-built binary.
# Option 1: Install via Go
go install github.com/AdamShannag/api-mcp-server/cmd/[email protected]
# Option 2: Run a pre-built binary (download from Releases page)Environment variables control how and where the server runs. You can set the host and port for the SSE transport and optionally enable a Bearer token for authentication.
You can also enable Prometheus metrics and health checks for monitoring by enabling the metrics server.
When you define tool configurations, you can substitute environment variables into the tool config values using a dedicated placeholder syntax so you can vary behavior by environment without changing the config file.
If you want to see an example startup with SSE authentication and a sample tool file, you can run the server with the following command and a config file that defines your tools.
api-mcp-server --transport sse --config ./demo.tools.jsonThe following example tools illustrate common MVP patterns for GitLab and JSONPlaceholder APIs. They are intended to demonstrate how inputs map to HTTP requests.
TriggerPipeline — Triggers a GitLab pipeline for a specific project and branch.
GitLab Issues — Tools for listing and creating issues in a GitLab project.
JSONPlaceholder Todos — Tools interacting with the JSONPlaceholder public API.
If you use the SSE transport, you can secure the endpoint with a Bearer token by setting an environment variable and providing the token in your requests.
Limit exposure of the tool endpoint to trusted networks and monitor metrics to detect unauthorized access.
Common issues include misconfigured environment variables, incorrect endpoints, or missing required arguments for a tool. Validate your tool configuration and environment values before starting the server.
Triggers a pipeline in GitLab for a specific project and branch.
Tools for listing and creating issues in a GitLab project.
Tools interacting with the JSONPlaceholder public API.