mcp-server
Servidor MCP local con Ollama
Un proyecto local en Python que conecta un modelo de lenguaje de Ollama a un servidor MCP. El modelo puede descubrir las herramientas del servidor, decidir cuándo llamar a una, recibir el resultado y producir una respuesta final concisa.
flowchart TD
U["User question"] --> C["Python MCP client"]
C --> O["Ollama llama3.2:3b"]
O --> C
C --> S["Local MCP server"]
S --> D["Student JSON data"]Herramientas disponibles
Herramienta | Propósito |
| Suma dos números proporcionados explícitamente |
| Devuelve el perfil de estudiante de demostración integrado |
| Busca en |
Related MCP server: py-mcp-students
Requisitos
Python 3.11+
Ollama instalado y en ejecución
Modelo de Ollama
llama3.2:3b
Configuración de Windows
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
ollama pull llama3.2:3b
python client.pyEl cliente ejecuta server.py automáticamente mediante el intérprete de Python activo. No es necesario iniciar el servidor en una terminal aparte.
Preguntas de ejemplo
What is 10 + 20?Tell me about Pranay.Where is Ananya studying?What is Saranya studying?
Estructura del proyecto
mcp-server/
├── client.py
├── server.py
├── files/
│ └── students.json
├── tests/
│ └── test_server.py
└── requirements.txtCorrección del resultado de la herramienta
Ollama espera que un mensaje de resultado de herramienta incluya el tool_name ejecutado. El cliente incluye este campo y pasa las definiciones de herramientas disponibles a la llamada de seguimiento, lo que permite al modelo producir la respuesta final después de que se ejecute una herramienta MCP.
Nota sobre los datos
files/students.json son datos de demostración. Sustitúyelos con datos ficticios o con consentimiento antes de utilizar este proyecto públicamente o en producción.
This server cannot be deployed
Maintenance
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
PDF, image, video, OCR, screenshot, SQL, QR and text tools for agents. No API key, no signup.
Search and run data, text, code, PDF and web APIs. Requests not stored. Network tools need a key.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes custom Python functions as tools and integrates with Ollama for tool calling.4MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to manage student records through natural language by wrapping a simple HTTP student server's endpoints as MCP tools.-
- FlicenseAqualityCmaintenanceEnables arithmetic calculation, current time lookup, and attendance retrieval through natural language tool calls.3-
- FlicenseAqualityCmaintenanceEnables an LLM client to perform basic arithmetic on two numbers — addition, subtraction, multiplication, and division — plus reverse a supplied text string, through five simple tools exposed over stdio. Inputs and structured text results follow JSON schemas, with invalid operations such as division by zero surfaced as tool errors.5-