StaticMCP STDIO Bridge
A lightweight stdio bridge server that serves StaticMCP files.
How It Works
The StaticMCP Bridge acts as a translation layer between the MCP protocol and your static JSON files:
- Manifest: A
mcp.jsonfile describes available resources and tools - Resources: Static JSON files in
resources/directory - Tools: Pre-computed tool responses in
tools/directory structure - Bridge: This server dynamically routes MCP requests to the appropriate JSON files
More about StaticMCP on https://staticmcp.com.
Installation
Or build from source:
Quick Start
1. Create a StaticMCP Directory Structure
my-static-mcp/
├── mcp.json # Manifest file
├── resources/
│ ├── README.md.json # Resource responses
│ └── config.json.json
└── tools/
├── search/
│ ├── rust.json # Tool response for search("rust")
│ └── javascript.json # Tool response for search("javascript")
└── analyze/
└── file.json # Tool response for analyze("file")
2. Create the Manifest (mcp.json)
3. Create Resource Files
resources/README.md.json:
4. Create Tool Response Files
tools/search/rust.json:
5. Run the Bridge
# Local directory
# Remote URL (hosted static files)
Usage with MCP Inspector
Test your StaticMCP server using the official MCP Inspector:
File Path Conventions
The bridge automatically maps MCP requests to file paths:
Resources
file://path/to/file→resources/path/to/file.jsoncustom://resource→resources/resource.json
Tools
- Single argument:
tools/{tool_name}/{arg_value}.json - Two arguments:
tools/{tool_name}/{arg1}/{arg2}.json(sorted)
Examples:
search("rust")→tools/search/rust.jsonanalyze(file="test.txt", format="json")→tools/analyze/json/test.txt.json
Response Format
Resource Responses
Tool Responses
Deployment Options
Static Web Hosting
Deploy your StaticMCP files to any static hosting service:
- Vercel:
vercel --prod - Netlify: Drag & drop or Git integration
- GitHub Pages: Push to
gh-pagesbranch - AWS S3: Upload files to S3 bucket with public access
- CDN: Use CloudFlare, AWS CloudFront, etc.
Example with Vercel
Then use: static-mcp-bridge https://my-mcp.vercel.app
Building StaticMCP Content
You can generate your StaticMCP files using any method:
Python Script
# Generate tool responses
=
Build Process
#!/bin/bash
# generate-mcp.sh
Advanced Features
Error Handling
If a requested file doesn't exist, the bridge returns an appropriate MCP error response.
CORS Support
When serving over HTTP, the bridge handles CORS headers automatically.
Caching
All responses are highly cacheable since content is static. Consider setting long cache headers when serving files.
Examples
Check out these example StaticMCP implementations:
- Resume MCP - Personal resume and portfolio
StaticMCP Bridge - Turn any static file hosting into a powerful MCP server! 🚀