FastMCP Basic Server
A basic MCP server implementation using the FastMCP framework that provides utility tools for greetings and mathematical calculations. It is designed to demonstrate tool integration for AI-assisted development workflows like Cline.
README
MCP Server using FastMCP
A basic Model Context Protocol (MCP) server implementation using FastMCP, designed for integration with Cline.
Overview
This project provides a simple MCP server that demonstrates how to create tools and expose them through the MCP protocol. It's designed to be integrated with Cline for AI-assisted development workflows.
Features
- Tool Definitions: Example tools for greeting, calculations, and server information
- FastMCP Framework: Built on the FastMCP library for simplified MCP server development
- Cline Integration: Ready to integrate with Cline for AI assistant capabilities
- Async Support: Full async/await support for non-blocking operations
Project Structure
mcp_server_using_fastmcp/
├── mcp_server/
│ ├── __init__.py # Package initialization
│ └── server.py # Main server implementation
├── pyproject.toml # Project configuration
├── README.md # This file
└── .github/
└── copilot-instructions.md # Copilot instructions
Installation
- Install dependencies:
pip install -e .
- For development with additional tools:
pip install -e ".[dev]"
Available Tools
1. get_greeting
Get a greeting message.
- Input:
name(string) - The name to greet - Output: Greeting message
2. calculate_sum
Calculate the sum of two numbers.
- Input:
a(float),b(float) - Output: Sum result
3. get_server_info
Get information about the MCP server.
- Output: Server information dictionary
Running the Server
python -m mcp_server.server
Or directly:
python mcp_server/server.py
Integrating with Cline
To integrate this MCP server with Cline:
- Ensure the server is installed and can be run
- Configure Cline to connect to this MCP server using the appropriate endpoint
- The available tools will be accessible within Cline's context
Development
Running Tests
pytest
Code Formatting
black mcp_server/
Linting
flake8 mcp_server/
MCP Protocol
This server implements the Model Context Protocol, which allows AI assistants and other tools to:
- Discover available tools and their parameters
- Call tools with structured arguments
- Receive structured responses
Adding New Tools
To add a new tool to the server, add a new function decorated with @server.call_tool():
@server.call_tool()
def my_tool(param1: str, param2: int) -> str:
"""
Tool description.
Args:
param1: Parameter description
param2: Parameter description
Returns:
Return value description
"""
# Implementation
return result
License
MIT
Contributing
Feel free to extend this server with additional tools and capabilities as needed.
#run this command to start the mcp server
python -m mcp_server.server
#use this cline configuration of MCP server
{
"mcpServers": {
"mcp-server-fastmcp": {
"command": "python",
"args": ["-m", "mcp_server.server"],
"cwd": "c:\\Ratnesh\\Dev\\third_mcp_server_using_fastmcp"
}
}
}
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.