abhay-2108/Remote-MCP-Server-Testing
If you are the rightful owner of Remote-MCP-Server-Testing and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This document provides a comprehensive overview of setting up and running a Model Context Protocol (MCP) server using FastMCP and uv.
MCP Demo Project
This project demonstrates setting up and running an MCP (Model Context Protocol) server using FastMCP and uv.
Prerequisites
- Python 3.11+
uvCLI toolfastmcpPython package- GitHub account (for repository)
- FastMCP Cloud account (free tier)
Setup Instructions
-
Initialize the project using
uvpip install uv uv init . -
Add FastMCP to the project
uv add fastmcp -
Create your MCP server file (e.g.,
main.py)from fastmcp import FastMCP mcp = FastMCP("DemoServer") @mcp.tool def add(a: int, b: int) -> int: return a + b if __name__ == "__main__": mcp.run() * To run MCP server locally. Default is to run locally mcp.run(transport="http",host="0.0.0.0",port=8000) * To run MCP server on FastMCP Cloud. -
Start the MCP server locally
uv run fastmcp run main.pyStart the Remote MCP server
fastmcp run main.py --transport http --host 0.0.0.0 --port or uv run main.py -
Test server using MCP Inspector
uv run fastmcp dev main.py- Allows you to test and inspect MCP tools locally (similar to Postman).
Deploy MCP Server on FastMCP Cloud as a Remote Server
-
Create a GitHub repository for your project and push your code.
-
Create a FastMCP Cloud account (free tier available at FastMCP Cloud).
-
Install project dependencies on cloud
uv add . uv add fastmcp -
Deploy your MCP server
uv run fastmcp deploy main.py --cloud -
Test deployed server using MCP Inspector or via your cloud URL.
- To integrate MCP server with Claude Desktop powershell uv run fastmcp install claude-desktop main.py
- Integrating MCP server with Claude Desktop is straightforward.
Using Proxy Server / Remote MCP Server Locally
You can connect to a remote MCP server using a proxy to access MCP tools locally. This is useful for testing cloud-deployed MCP servers or running your server from a remote environment.
Steps
- Ensure your remote MCP server is deployed and accessible (for example, on FastMCP Cloud).
- Use the
as_proxymethod to create a proxy client in your local environment.
Example: Using as_proxy Method
from fastmcp import FastMCP
# Connect to the remote MCP server using proxy
mcp = FastMCP.as_proxy("https://your-remote-mcp-server.fastmcp.ai")
# Call remote MCP tools as if they were local
result = mcp.add_expense(item="Lunch", amount=12.5, category="Food")
print(result)
summary = mcp.expense_summary()
print(summary)
This setup allows you to interact with the remote MCP server seamlessly, as
Project Structure
MCP Demo Project/
├─ main.py # MCP server code
├─ uv.yaml # Project config (generated by uv)
├─ README.md # Project documentation
└─ .venv/ # Project virtual environment (managed by uv)
Notes
- Use
uv run fastmcp dev main.pyfor development and testing. - Use
uv run fastmcp run main.pyfor running the production MCP server locally. - Deploy on FastMCP Cloud using
uv run fastmcp deploy main.py --cloud. - All MCP tools are defined in
main.pyunder@mcp.tooldecorators.