MCP API Server
A Model Context Protocol (MCP) server that provides HTTP API calling capabilities. This server allows MCP clients to make HTTP requests (GET, POST, PUT, DELETE) through standardized MCP tools.
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:
Global Installation
Local Installation
Usage
Basic Usage
Environment Variables
Configure the server using environment variables:
Configuration Options
Option | Environment Variable | Default | Description |
---|---|---|---|
--debug | DEBUG | false | Enable debug logging |
--allow-localhost | ALLOW_LOCALHOST | false | Allow requests to localhost/127.0.0.1 |
--allow-private-ips | ALLOW_PRIVATE_IPS | false | Allow requests to private IP ranges |
N/A | API_TIMEOUT | 30000 | Request timeout in milliseconds |
N/A | MAX_RESPONSE_LENGTH | 50000 | Maximum response length in bytes |
N/A | USER_AGENT | MCP-API-Server/1.0.0 | Custom user agent string |
Available Tools
The server provides the following MCP tools:
api_get
Make an HTTP GET request.
Parameters:
url
(string): The URL to requestheaders
(object, optional): HTTP headers to include
api_post
Make an HTTP POST request.
Parameters:
url
(string): The URL to requestbody
(string, optional): Request bodyheaders
(object, optional): HTTP headers to include
api_put
Make an HTTP PUT request.
Parameters:
url
(string): The URL to requestbody
(string, optional): Request bodyheaders
(object, optional): HTTP headers to include
api_delete
Make an HTTP DELETE request.
Parameters:
url
(string): The URL to requestheaders
(object, optional): HTTP headers to include
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
:
With Custom Configuration
Development
Building from Source
Development Mode
Security Considerations
- By default, requests to localhost and private IP ranges are blocked
- Use
--allow-localhost
and--allow-private-ips
flags carefully in production - The 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
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.
Related MCP Servers
- -securityFlicense-qualityA versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.Last updated -13Python
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -61TypeScript
- -securityFlicense-qualityA Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.Last updated -1Python
- -securityFlicense-qualityA Model Context Protocol server that extends AI capabilities through tools for remote control, note-taking, email operations, and knowledge search.Last updated -Python