basic-mcp

basic-mcp

A minimal MCP server for text processing, providing word count, uppercase conversion, and a summarization prompt template.

Category
Visit Server

README

Text Assistant MCP Server

A minimal MCP (Model Context Protocol) compatible server that provides simple tools, resources, and prompt templates for text processing. Built with FastAPI and FastMCP for seamless integration.

Features

šŸ”¹ Resources

  • /resources/example-text
    • Description: A sample paragraph of text that agents can read.
    • Content: "The quick brown fox jumps over the lazy dog. This sentence contains every letter of the alphabet."
    • File: resources/example-text.txt

šŸ”¹ Tools

  1. count_words(text: str) -> int

    • Description: Returns the number of words in the given text.
    • Input: {"text": "your text here"}
  2. to_uppercase(text: str) -> str

    • Description: Converts the input text to uppercase.
    • Input: {"text": "your text here"}

šŸ”¹ Prompts

  1. summarize_prompt(language: str, text: str)
    • Template: "Summarize the following text in {language}:\n\n{text}"
    • Description: Allows the agent to generate a summary in the desired language by filling in language and text.
    • File: prompts/summarize_prompt.txt

Behavior

  • The MCP server does not maintain memory.
  • The agent is responsible for discovering and choosing tools, reading resources, and filling in prompts.
  • If a tool uses an LLM internally (e.g. in future expansions), the MCP server would pay for that usage.

Installation & Setup

Prerequisites

  • Docker and Docker Compose

Docker Deployment

  1. Build and run with Docker Compose:

    docker-compose up --build
    
  2. For debugging with VS Code:

    # Set DEBUG=true in .env file
    docker-compose up --build
    # Then attach debugger in VS Code
    

Usage

FastAPI Endpoints

  • GET /health - Health check endpoint
  • GET /mcp/tools - List available MCP tools
  • POST /mcp/tools/{tool_name} - Execute MCP tools
  • GET /mcp/resources - List available MCP resources
  • GET /mcp/resources/{resource_name} - Read MCP resources
  • GET /mcp/prompts - List available MCP prompts

MCP Protocol

The server implements the Model Context Protocol using FastMCP and can be used with MCP-compatible clients.

Example MCP Client Configuration

{
  "mcpServers": {
    "text-assistant": {
      "command": "docker",
      "args": ["run", "--rm", "my-fastapi-app:1.0.0"],
      "env": {}
    }
  }
}

Development

Project Structure

basic-mcp/
ā”œā”€ā”€ app.py              # FastAPI application with FastMCP integration
ā”œā”€ā”€ requirements.txt    # Python dependencies
ā”œā”€ā”€ Dockerfile         # Docker container definition
ā”œā”€ā”€ docker-compose.yml # Docker Compose configuration
ā”œā”€ā”€ entrypoint.sh      # Container startup script
ā”œā”€ā”€ resources/         # Static resources
│   └── example-text.txt
ā”œā”€ā”€ prompts/           # Prompt templates
│   └── summarize_prompt.txt
ā”œā”€ā”€ .vscode/           # VS Code configuration
│   └── launch.json    # Debug configuration
└── README.md          # This file

Debugging

  1. Set DEBUG=true in your .env file
  2. Start the container: docker-compose up --build
  3. In VS Code, use "Attach to Docker Container" configuration
  4. Set breakpoints and debug the FastAPI application

Adding New Features

  • Tools: Add new functions with @mcp.tool("tool_name") decorator
  • Resources: Add new files to the resources/ directory
  • Prompts: Add new template files to the prompts/ directory

License

This project is open source and available under the MIT License.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured