Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP API Serverget the latest posts from the Reddit API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Builder CLI
A command-line interface for generating Model Context Protocol (MCP) servers from API specifications. This package provides two separate tools:
MCP Builder CLI (
mcp-builder) - Generate custom MCP servers from API specification documentsMCP API Server (
mcp-api-server) - Make HTTP requests from AI assistants like Claude
What is this for?
This package contains two distinct tools that serve different purposes:
MCP Builder CLI (mcp-builder)
Generate custom MCP servers from API specification documents. This tool helps developers create MCP servers tailored to specific APIs.
MCP API Server (mcp-api-server)
Allow AI assistants like Claude to make HTTP requests (GET, POST, PUT, DELETE) to any web API directly. This acts as a bridge between AI assistants and web APIs, enabling them to:
Fetch data from REST APIs
Send data to web services
Interact with online tools and platforms
For example, you could ask Claude to check the weather by making a request to a weather API, or ask it to shorten a URL using a URL shortening service.
Related MCP server: MCP Toolkit
Quickstart Guide
1. Using the Built-in API Server with Claude Desktop (Easiest)
First, configure Claude Desktop to use the built-in MCP API server:
Open Claude Desktop
Go to the MCP configuration file (usually located at
~/.config/claude/claude_desktop_config.jsonon Mac/Linux or%APPDATA%/Claude/claude_desktop_config.jsonon Windows)Add this server configuration:
{
"mcpServers": {
"api-server": {
"command": "npx",
"args": ["mcp-api-server"]
}
}
}Restart Claude Desktop
You can now use the API tools in Claude!
2. Running the API Server Directly
The easiest way to run the API server is using NPX (no installation required):
npx mcp-api-serverFor development/testing, you might want to enable debug logging and allow localhost requests:
npx mcp-api-server --debug --allow-localhostYou can also run the server directly with Node:
node dist/src/index.jsWith debug and localhost access:
node dist/src/index.js --debug --allow-localhost3. Installing Globally
To install the tools globally on your system:
npm install -g mcp-builderThen run the API server with:
mcp-api-server4. Using with Claude
Once configured, you can ask Claude to make API requests:
"Can you get the latest news from https://api.example.com/news/latest?"
"Please post this data to my webhook: {"message": "Hello World"}"
Claude will automatically use the appropriate tool (api_get, api_post, etc.) based on what you're asking for.
Features
🚀 HTTP API Tools: GET, POST, PUT, DELETE request support
🔒 Security: Request validation with configurable security policies
📝 Logging: Comprehensive debug logging and request tracking
⚙️ Configurable: Flexible configuration via CLI args and environment variables
🛡️ Error Handling: Robust error handling with detailed error messages
🔄 Graceful Shutdown: Proper cleanup and shutdown handling
Installation
NPX (Recommended)
Run directly without installation:
npx mcp-builderGlobal Installation
npm install -g mcp-builder
mcp-builderLocal Installation
npm install mcp-builder
npx mcp-builderUsage
API Server Usage
# Start the API server
mcp-api-server
# Start with debug logging
mcp-api-server --debug
# Allow localhost requests (useful for development)
mcp-api-server --allow-localhost
# Allow private IP requests
mcp-api-server --allow-private-ips
# Show help
mcp-api-server --helpYou can also run the API server directly with Node:
# Start the API server directly
node dist/src/index.js
# Start with debug logging
node dist/src/index.js --debug
# Allow localhost requests
node dist/src/index.js --allow-localhost
# Allow private IP requests
node dist/src/index.js --allow-private-ips
# Show help
node dist/src/index.js --helpEnvironment Variables
Configure the API server using environment variables:
# Server Configuration
API_TIMEOUT=60000 # Request timeout in milliseconds
ALLOW_LOCALHOST=true # Allow requests to localhost (127.0.0.1)
ALLOW_PRIVATE_IPS=false # Allow requests to private IP ranges
MAX_RESPONSE_LENGTH=100000 # Maximum response length in bytes
USER_AGENT="MyApp/1.0.0" # Custom user agent string for requests
# Debug Configuration
DEBUG=true # Enable detailed loggingMCP Builder CLI Usage
The MCP Builder CLI is used to generate custom MCP servers from API specification documents:
# Generate an MCP server from an API specification
mcp-builder generate <api-spec.md> <output-directory>
# Validate an API specification file
mcp-builder validate <api-spec.md>
# Show help
mcp-builder --help
# Show help for a specific command
mcp-builder help generateConfiguration Options
CLI Option | Environment Variable | Default | Description |
|
|
| Enable debug logging |
|
|
| Allow requests to localhost |
|
|
| Allow requests to private IPs |
N/A |
|
| Request timeout in milliseconds |
N/A |
|
| Maximum response length in bytes |
N/A |
|
| Custom user agent string |
Available Tools
The API server provides the following MCP tools that Claude or other MCP clients can use:
api_get
Make an HTTP GET request to retrieve data from a URL.
Parameters:
url(string): The URL to request data fromheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Can you fetch the JSON data from https://api.example.com/users?"
api_post
Make an HTTP POST request to send data to a URL.
Parameters:
url(string): The URL to send data tobody(string or object, optional): The data to sendheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Please post this JSON to my webhook: {"name": "John", "age": 30}"
api_put
Make an HTTP PUT request to update data at a URL.
Parameters:
url(string): The URL to update data atbody(string or object, optional): The updated dataheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Update my user profile with this data: {"name": "John Smith", "age": 31}"
api_delete
Make an HTTP DELETE request to remove data at a URL.
Parameters:
url(string): The URL to delete data fromheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Please delete the user with ID 123 from https://api.example.com/users/123"
MCP Client Configuration
To use this server with an MCP client, add it to your MCP configuration:
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"api-server": {
"command": "npx",
"args": ["mcp-api-server"]
}
}
}With Custom Configuration
{
"mcpServers": {
"api-server": {
"command": "npx",
"args": ["mcp-api-server", "--debug", "--allow-localhost"]
}
}
}You can also run the server directly with Node:
{
"mcpServers": {
"api-server": {
"command": "node",
"args": ["dist/src/index.js", "--debug", "--allow-localhost"]
}
}
}Security Considerations
By default, requests to localhost and private IP ranges are blocked to prevent SSRF attacks
Only enable
--allow-localhostand--allow-private-ipsin trusted environmentsThe server validates all requests and sanitizes responses
Request timeouts prevent hanging connections
Response size limits prevent memory exhaustion
Error Handling
The server provides detailed error messages for:
Invalid URLs
Network timeouts
JSON parsing errors
Validation failures
HTTP errors
All errors are logged with timestamps and context for debugging.
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Support
Report issues: GitHub Issues
Documentation: GitHub Repository
Installation
NPX (Recommended)
Run directly without installation:
npx mcp-builderGlobal Installation
npm install -g mcp-builder
mcp-builderLocal Installation
npm install mcp-builder
npx mcp-builderUsage
Basic Usage
# Start the server
mcp-api-server
# Start with debug logging
mcp-api-server --debug
# Allow localhost requests (useful for development)
mcp-api-server --allow-localhost
# Allow private IP requests
mcp-api-server --allow-private-ips
# Show help
mcp-api-server --helpYou can also run the server directly with Node:
# Start the server
node dist/src/index.js
# Start with debug logging
node dist/src/index.js --debug
# Allow localhost requests
node dist/src/index.js --allow-localhost
# Allow private IP requests
node dist/src/index.js --allow-private-ips
# Show help
node dist/src/index.js --helpEnvironment Variables
Configure the server using environment variables:
# Server Configuration
API_TIMEOUT=60000 # Request timeout in milliseconds
ALLOW_LOCALHOST=true # Allow requests to localhost (127.0.0.1)
ALLOW_PRIVATE_IPS=false # Allow requests to private IP ranges
MAX_RESPONSE_LENGTH=100000 # Maximum response length in bytes
USER_AGENT="MyApp/1.0.0" # Custom user agent string for requests
# Debug Configuration
DEBUG=true # Enable detailed loggingConfiguration Options
CLI Option | Environment Variable | Default | Description |
|
|
| Enable debug logging |
|
|
| Allow requests to localhost |
|
|
| Allow requests to private IPs |
N/A |
|
| Request timeout in milliseconds |
N/A |
|
| Maximum response length in bytes |
N/A |
|
| Custom user agent string |
Available Tools
The server provides the following MCP tools that Claude or other MCP clients can use:
api_get
Make an HTTP GET request to retrieve data from a URL.
Parameters:
url(string): The URL to request data fromheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Can you fetch the JSON data from https://api.example.com/users?"
api_post
Make an HTTP POST request to send data to a URL.
Parameters:
url(string): The URL to send data tobody(string or object, optional): The data to sendheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Please post this JSON to my webhook: {"name": "John", "age": 30}"
api_put
Make an HTTP PUT request to update data at a URL.
Parameters:
url(string): The URL to update data atbody(string or object, optional): The updated dataheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Update my user profile with this data: {"name": "John Smith", "age": 31}"
api_delete
Make an HTTP DELETE request to remove data at a URL.
Parameters:
url(string): The URL to delete data fromheaders(object, optional): HTTP headers to include in the request
Example usage with Claude:
"Please delete the user with ID 123 from https://api.example.com/users/123"
MCP Client Configuration
To use this server with an MCP client, add it to your MCP configuration:
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"api-server": {
"command": "npx",
"args": ["mcp-api-server"]
}
}
}With Custom Configuration
{
"mcpServers": {
"api-server": {
"command": "npx",
"args": ["mcp-api-server", "--debug", "--allow-localhost"]
}
}
}Security Considerations
By default, requests to localhost and private IP ranges are blocked to prevent SSRF attacks
Only enable
--allow-localhostand--allow-private-ipsin trusted environmentsThe server validates all requests and sanitizes responses
Request timeouts prevent hanging connections
Response size limits prevent memory exhaustion
Error Handling
The server provides detailed error messages for:
Invalid URLs
Network timeouts
JSON parsing errors
Validation failures
HTTP errors
All errors are logged with timestamps and context for debugging.
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Support
Report issues: GitHub Issues
Documentation: GitHub Repository