Serves as the foundation of the MCP server, handling HTTP requests and routing them to the appropriate tool implementations.
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., "@Multi-Capability Proxy Serverget all posts from example_tool"
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 (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
Related MCP server: Model Control Plane (MCP) Server
Setup and Running
Clone the repository (if applicable) or ensure all files are in place.
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun the server:
python mcp_server.pyThe server will start, by default on
http://127.0.0.1:5001. It will also create thetoolsdirectory and a basicexample_tool.pyif 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:
curl http://127.0.0.1:5001/This will show
example_tooland its available actions.Get all posts (using
curl http://127.0.0.1:5001/example_tool/get_postsGet a specific post by ID (using
curl http://127.0.0.1:5001/example_tool/get_post_by_id?id=1Create a new post (using
curl -X POST -H "Content-Type: application/json" \ -d '{"data": {"title": "My New Post", "body": "This is the content.", "userId": 1}}' \ http://127.0.0.1:5001/example_tool/create_post
Adding New Tools
Create a new Python file in the
tools/directory (e.g.,my_new_tool.py).Implement the
This function will receive the
actionname (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.
Implement the
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.pyfor a template.
(Optional) Add configuration for your new tool in
config.pyand 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.