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
This server cannot be installed
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.
Related MCP Servers
- AsecurityAlicenseAqualityA 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 -235MIT License
- AsecurityAlicenseAqualityA starter template for building MCP servers with FastMCP, providing testing, linting, formatting, and NPM publishing setup.Last updated -11MIT License
- -securityFlicense-qualityA 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 -
- -securityFlicense-qualityA 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