linsun
MCP Serverlinsunpublic

simple agent and mcp server

exploring writing a simple agent and mcp server

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

About This Server

exploring writing a simple agent and mcp server

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Model Context Protocol (MCP) Server & Agent

A simple implementation of a Model Context Protocol server that manages context data for AI models.

Setup

  1. Install the required dependencies:
uv venv
uv pip install -r requirements.txt
  1. Run the server:
uv run server.py

The server will start on localhost:8080.

API Endpoints

Store Context

curl -X POST http://localhost:8080/mcp/context \
  -H "Content-Type: application/json" \
  -d '{
    "context_id": "example-context",
    "data": {
      "key": "value",
      "metadata": "example"
    }
  }'

Get Context

curl -X GET http://localhost:8080/mcp/context/example-context

Delete Context

curl -X DELETE http://localhost:8080/mcp/context/example-context

list all the tools

curl -X GET http://localhost:8080/mcp/tools

Run the agent

OPENAI_API_KEY=$OPENAI_API_KEY uv run agent.py 

Sample output:

Connected to server
LLM decided to use: calculator
Reasoning: The user is asking for the sum of 5 and 3, which is a basic arithmetic operation suitable for the calculator tool.
Tool 'calculator' executed with result: {'status': 'success', 'result': 8}

Final result: {'status': 'success', 'result': 8}
LLM decided to use: calculator
Reasoning: The user requested to multiply two numbers, so a calculator tool is appropriate to perform this arithmetic operation.
Tool 'calculator' executed with result: {'status': 'success', 'result': 24}

Final result: {'status': 'success', 'result': 24}
Disconnected from server

Quick Start

1

Clone the repository

git clone https://github.com/linsun/simple-agent-and-mcp-server
2

Install dependencies

cd simple-agent-and-mcp-server
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerlinsun
Reposimple-agent-and-mcp-server
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation