Provides tools for interacting with GitHub's REST API, including retrieving user information and other GitHub operations through dynamically configured endpoints.
APIWeaver
A FastMCP server that dynamically creates MCP (Model Context Protocol) servers from web API configurations. This allows you to easily integrate any REST API, GraphQL endpoint, or web service into an MCP-compatible tool that can be used by AI assistants like Claude.
Features
๐ Dynamic API Registration: Register any web API at runtime
๐ Multiple Authentication Methods: Bearer tokens, API keys, Basic auth, OAuth2, and custom headers
๐ ๏ธ All HTTP Methods: Support for GET, POST, PUT, DELETE, PATCH, and more
๐ Flexible Parameters: Query params, path params, headers, and request bodies
๐ Automatic Tool Generation: Each API endpoint becomes an MCP tool
๐งช Built-in Testing: Test API connections before using them
๐ Response Handling: Automatic JSON parsing with fallback to text
๐ Multiple Transport Types: STDIO, SSE, and Streamable HTTP transport support
Transport Types
APIWeaver supports three different transport types to accommodate various deployment scenarios:
STDIO Transport (Default)
Usage:
apiweaver runorapiweaver run --transport stdioBest for: Local tools, command-line usage, and MCP clients that connect via standard input/output
Characteristics: Direct process communication, lowest latency, suitable for desktop applications
Endpoint: N/A (uses stdin/stdout)
SSE Transport (Legacy)
Usage:
apiweaver run --transport sse --host 127.0.0.1 --port 8000Best for: Legacy MCP clients that only support Server-Sent Events
Characteristics: HTTP-based, one-way streaming from server to client
Endpoint:
http://host:port/mcpNote: This transport is deprecated in favor of Streamable HTTP
Streamable HTTP Transport (Recommended)
Usage:
apiweaver run --transport streamable-http --host 127.0.0.1 --port 8000Best for: Modern web deployments, cloud environments, and new MCP clients
Characteristics: Full HTTP-based communication, bidirectional streaming, better error handling
Endpoint:
http://host:port/mcpRecommended: This is the preferred transport for new deployments
Installation
Usage
Claude Desktop
Starting the Server
There are several ways to run the APIWeaver server with different transport types:
1. After installation (recommended):
If you have installed the package (e.g., using pip install . from the project root after installing requirements):
2. Directly from the repository (for development):
Transport Options:
--transport: Choose fromstdio(default),sse, orstreamable-http--host: Host address for HTTP transports (default: 127.0.0.1)--port: Port for HTTP transports (default: 8000)--path: URL path for MCP endpoint (default: /mcp)
Run apiweaver run --help for all available options.
Using with AI Assistants (like Claude Desktop)
APIWeaver is designed to expose web APIs as tools for AI assistants that support the Model Context Protocol (MCP). Here's how to use it:
Start the APIWeaver Server:
For modern MCP clients (recommended):
apiweaver run --transport streamable-http --host 127.0.0.1 --port 8000For legacy compatibility:
apiweaver run --transport sse --host 127.0.0.1 --port 8000For local desktop applications:
apiweaver run # Uses STDIO transportConfigure Your AI Assistant: The MCP endpoint will be available at:
Streamable HTTP:
http://127.0.0.1:8000/mcpSSE:
http://127.0.0.1:8000/mcpSTDIO: Direct process communication
Register APIs and Use Tools: Once connected, use the built-in
register_apitool to define web APIs, then use the generated endpoint tools.
Core Tools
The server provides these built-in tools:
register_api - Register a new API and create tools for its endpoints
list_apis - List all registered APIs and their endpoints
unregister_api - Remove an API and its tools
test_api_connection - Test connectivity to a registered API
call_api - Generic tool to call any registered API endpoint
get_api_schema - Get schema information for APIs and endpoints
API Configuration Format
Examples
Example 1: OpenWeatherMap API
Example 2: GitHub API
Authentication Types
Bearer Token
API Key (Header)
API Key (Query Parameter)
Basic Authentication
Custom Headers
Parameter Locations
query: Query string parameters (
?param=value)path: Path parameters (
/users/{id})header: HTTP headers
body: Request body (for POST, PUT, PATCH)
Parameter Types
string: Text values
integer: Whole numbers
number: Decimal numbers
boolean: true/false
array: Lists of values
object: JSON objects
Advanced Features
Custom Timeouts
Enum Values
Default Values
Claude Desktop Configuration
For Streamable HTTP Transport (Recommended)
For STDIO Transport (Traditional)
Error Handling
The server provides detailed error messages for:
Missing required parameters
HTTP errors (with status codes)
Connection failures
Authentication errors
Invalid configurations
Tips
Choose the Right Transport: Use
streamable-httpfor modern deployments,stdiofor local toolsTest First: Always use
test_api_connectionafter registering an APIStart Simple: Begin with GET endpoints before moving to complex POST requests
Check Auth: Ensure your authentication credentials are correct
Use Descriptions: Provide clear descriptions for better AI understanding
Handle Errors: The server will report HTTP errors with details
Troubleshooting
Common Issues
401 Unauthorized: Check your authentication credentials
404 Not Found: Verify the base URL and endpoint paths
Timeout Errors: Increase the timeout value for slow APIs
SSL Errors: Some APIs may require specific SSL configurations
Debug Mode
Run with verbose logging (if installed):
Transport-Specific Issues
STDIO: Ensure the client properly handles stdin/stdout communication
SSE: Check that the HTTP endpoint is accessible and CORS is configured
Streamable HTTP: Verify the MCP endpoint responds to HTTP requests
Contributing
Feel free to extend this server with additional features:
OAuth2 token refresh
GraphQL support
WebSocket endpoints
Response caching
Rate limiting
Request retries
License
MIT License - feel free to use and modify as needed.