mcp-template

jadonduff/mcp-template

3.1

If you are the rightful owner of mcp-template 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 minimal MCP server template in Python, designed for integration with Agentic LLMs.

Tools
4
Resources
0
Prompts
0

mcp-template

A minimal MCP server written in Python. Includes examples of static, functional, dynamic pull, and dynamic push MCP tools for use with Agentic LLMs.

Note: server.py contains the example tools, while minimal.py is a template-ready MCP server, ready for you to add your own tools.


Features

  • Static Tool: hello_world → Always returns "Hello, world!"
  • Function Tool: calculate → Performs basic arithmetic operations
  • Dynamic Pull Tool: get_forecast → Fetches live weather data from weather.gov
  • Agentic Push Tool: create_file → Creates a new file locally with proper line endings for the chosen OS

Setup

  1. Clone this repository:

    git clone https://github.com/yourusername/mcp-template.git
    cd mcp-template
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run the MCP server:

    python server.py
    

Usage with Cline

You can integrate this server with Cline using its MCP server tools.

  1. Open the Cline extension.
  2. Go to MCP ServersConfigure MCP servers.
  3. Add the following configuration (adjust the path to your server.py):
{
  "mcpServers": {
    "server1": {
      "command": "python",
      "args": ["path/to/server.py"],
      "alwaysAllow": ["hello_world"],
      "disabled": false
    }
  }
}

Example Tools

hello_world

Returns a static string:

"Hello, world!"

calculate

Perform math operations:

{
  "operator": "+",
  "a": 5,
  "b": 3
}

8

get_forecast

Fetch a forecast:

{
  "lat": 38.9072,
  "lon": -77.0369
}

"Tonight: Clear, with a low around 65."

create_file

Note that the create_file tool may fail due to OS restrictions.

Create a file locally:

{
  "os_type": "Mac",
  "content": "Hello file system!"
}

"File 'output_mac.txt' created successfully with 18 characters."


Project Info

Filename: server.py
Author: Jadon Duff (jadonduff)
Created: 8/17/2025
Version: 1.0.0

MIT Licensed.