Skip to main content
Glama

Basic MCP

by nimishgautam

basic mcp

The goal of this is just to write a simple MCP server with a handful of tools that can be plugged in to a local LLM.

It's just for experimentation but also straightforward enough to be human-readable (for those trying to learn)

Learning

In src/basic_mcp/main.py you see how straightforward it is to make an MCP server with FastMCP. It's just calling something, and the pandoc comments are what are given to the LLM.

Note that MCP servers are (in some way) just polite suggestions of text to LLMs, so without the comments here it actually won't work (or will work many orders of magnitude worse).

In src/basic_mcp/tools/web_tools.py there's a simple 'fetch article' tool. This is just so I have a placeholder/structure for extra tools as they're needed

install

As with everything, you should set this up in a virtualenv.

Then it's just a pip install -e .

running

cd src/basic_mcp && python main.py

uvx

This can be called with uvx --from /path/to/basic-mcp/ basic-mcp if it needs to be launched that way (for example with Jan)

Also note/remember that if it's in a virtualenv, uvx should be called with the full path name from within the virtualenv's bin.

Output

Note that the output is stdio and not a web server. This can be changed simply enough inside the main function and removing the transport variable parameter. Then it will default to being a web server

-
security - not tested
A
license - permissive license
-
quality - not tested

A simple MCP server built with FastMCP for experimentation and learning purposes. Includes basic web tools like article fetching and serves as a human-readable template for building custom MCP servers.

  1. Learning
    1. install
      1. running
        1. uvx
        2. Output

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        A simple MCP server that facilitates website fetching through a configurable server platform using stdio or SSE transport, allowing integration with tools like Cursor for streamlined access.
        Last updated -
        2
        35
        MIT License
      • A
        security
        A
        license
        A
        quality
        A starter template for building MCP servers with FastMCP, providing testing, linting, formatting, and NPM publishing setup.
        Last updated -
        1
        1
        MIT License
      • -
        security
        F
        license
        -
        quality
        A lightweight MCP server implementation that provides a simple tool for fetching website content, demonstrating how tools can be exposed and interacted with using the MCP protocol.
        Last updated -
      • -
        security
        F
        license
        -
        quality
        A basic MCP server template built with FastMCP that provides simple tools for greeting users, performing math operations, and managing user information. Serves as a starting point for building custom MCP servers with essential functionality examples.
        Last updated -
        4
        • Apple

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/nimishgautam/basic-mcp'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server