Serves as the foundation of the MCP server, handling HTTP requests and routing them to the appropriate tool implementations.
MCP (Multi-Capability Proxy) Server
This project implements a simple MCP server using Flask. The server can host multiple "tools," where each tool exposes functionalities by calling external REST APIs.
Project Structure
Setup and Running
- Clone the repository (if applicable) or ensure all files are in place.
- Create a virtual environment (recommended):
- Install dependencies:
- Run the server:The server will start, by default on
http://127.0.0.1:5001
. It will also create thetools
directory and a basicexample_tool.py
if they don't exist upon first run (though they are included in this setup).
Using the MCP Server
The server exposes the following endpoints:
GET /
: Lists all available tools and their descriptions.GET /<tool_name>/<action>?param1=value1¶m2=value2
: Executes an action for a specific tool using GET. Parameters are passed as query strings.POST /<tool_name>/<action>
: Executes an action for a specific tool using POST. Parameters should be sent as a JSON body.
Example: Interacting with example_tool
The example_tool
interacts with https://jsonplaceholder.typicode.com
.
- List available tools:This will show
example_tool
and its available actions. - Get all posts (using
example_tool
): - Get a specific post by ID (using
example_tool
): - Create a new post (using
example_tool
):
Adding New Tools
- Create a new Python file in the
tools/
directory (e.g.,my_new_tool.py
). - Implement the
execute(action, params)
function:- This function will receive the
action
name (string) andparams
(dictionary) from the request. - It should contain the logic to call the external API based on the action and params.
- It must return a JSON-serializable dictionary or list.
- This function will receive the
- Implement the
get_tool_description()
function:- This function should return a dictionary describing the tool, including its name, a general description, and a dictionary of available actions with their descriptions and parameters. See
tools/example_tool.py
for a template.
- This function should return a dictionary describing the tool, including its name, a general description, and a dictionary of available actions with their descriptions and parameters. See
- (Optional) Add configuration for your new tool in
config.py
and import it into your tool file. - Restart the MCP server. It will automatically detect and load the new tool.
Example structure for a new tool (tools/my_new_tool.py
):
This provides a flexible way to extend the MCP server's capabilities.
This server cannot be installed
A Flask-based server that hosts multiple tools, each exposing functionalities by calling external REST APIs through a unified interface.
Related MCP Servers
- AsecurityFlicenseAqualityA server providing a unified interface to interact with Firebase services, including Authentication, Firestore, and Storage.Last updated -97TypeScript
- -securityAlicense-qualityA server implementation that provides a unified interface for OpenAI services, Git repository analysis, and local filesystem operations through REST API endpoints.Last updated -PythonGPL 3.0
- -securityAlicense-qualityA server that enables interaction with WordPress sites through REST API, allowing users to create, retrieve, and update posts using JSON-RPC 2.0 protocol.Last updated -1JavaScriptMIT License
- -securityFlicense-qualityServer that ingests Swagger/OpenAPI specifications and Postman collections, providing just 4 strategic tools that allow AI agents to dynamically discover and interact with APIs instead of generating hundreds of individual tools.Last updated -2TypeScript