sharmaratnesh/third_mcp_server_using_fastmcp
If you are the rightful owner of third_mcp_server_using_fastmcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A basic Model Context Protocol (MCP) server implementation using FastMCP, designed for integration with Cline.
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"
}
}
}