MCP Hackathon Server
OfficialGSA MCP Hackathon — Plantilla de servidor
Un iniciador listo para ejecutar para construir un servidor Model Context Protocol (MCP) en Python, además de kits de despliegue para IBM Cloud (watsonx Orchestrate) y Databricks.
Construido con FastMCP y uv. Si nunca has construido un servidor MCP antes, comienza con QUICKSTART.md.
¿Qué es un servidor MCP?
Un servidor MCP expone herramientas (funciones que el modelo puede llamar), prompts (iniciadores de conversación reutilizables) y recursos (datos que el modelo puede leer) a un cliente de IA como Claude Desktop, Claude Code, o una plataforma de agentes como watsonx Orchestrate. Tú escribes las herramientas; el modelo del cliente decide cuándo llamarlas.
Esta plantilla te ofrece un servidor funcional con un ejemplo de cada uno, para que puedas reemplazar los ejemplos con tu propio servicio y desplegarlo.
Related MCP server: Python MCP Server Template
Estructura del repositorio
mcp-hackathon-template/
├── README.md # This file
├── QUICKSTART.md # 5-minute clone → run → connect walkthrough
├── main.py # Local entry point (uv run python main.py)
├── pyproject.toml # Package + dependencies (uv)
├── requirements.txt # Mirror of runtime deps (for buildpack hosts)
├── Dockerfile # Container image (streamable-HTTP, port 8080)
├── manifest.yaml # cloud.gov (Cloud Foundry) deploy
├── server.json # MCP registry metadata
├── .env.example # Copy to .env for local dev
├── .github/workflows/ci.yml # Lint + test on push/PR
├── src/
│ └── example_server/ # ← rename to your service
│ ├── app.py # Thin entry point: builds FastMCP, picks transport
│ ├── config.py # Settings from env vars / .env
│ ├── models.py # Pydantic models & enums for tool params
│ ├── utils.py # Shared helpers (HTTP client, pagination)
│ ├── routes.py # HTTP-only routes (/health, /version)
│ ├── tools/ # ONE FILE PER TOOL
│ │ ├── __init__.py # register_tools(mcp) aggregator
│ │ └── example_tool.py
│ ├── prompts/
│ │ ├── __init__.py # register_prompts(mcp) aggregator
│ │ └── example.py
│ └── resources/
│ ├── __init__.py # register_resources(mcp) aggregator
│ └── example.py
├── tests/ # Import + registration smoke tests
├── eval/ # Stub → build a Phoenix eval harness (see mcp-eval skill)
└── deploy/
├── README.md # Which deployment kit to use
├── ibm/ # watsonx Orchestrate: 3 kits (see below)
└── databricks/ # Databricks Apps kitPrimeros pasos
Requisitos previos
uv —
pip install uvobrew install uv
Instalar y ejecutar
cp .env.example .env
uv sync
uv run python main.pyEl servidor se inicia en modo stdio — habla JSON-RPC a través de stdin/stdout, que es como los clientes locales (Claude Desktop, Claude Code) lo lanzan. Consulta QUICKSTART.md para conectar un cliente.
Verificar
uv sync --group dev
uv run pytest tests/ -v # tests
uv run ruff check . # lintEl patrón de una herramienta por archivo
Cada herramienta vive en su propio archivo bajo src/example_server/tools/ y expone una función register(mcp). tools/__init__.py llama a cada una desde un único register_tools(mcp). Esto mantiene la lista de herramientas escaneable y te permite añadir o eliminar una integración tocando dos archivos.
Paso 1 — crea src/example_server/tools/my_tool.py:
from typing import Annotated
from fastmcp import FastMCP
from example_server.utils import fetch_json
def register(mcp: FastMCP) -> None:
@mcp.tool(
name="example_get_thing",
annotations={
"title": "Get a thing",
"readOnlyHint": True,
"destructiveHint": False,
"idempotentHint": True,
"openWorldHint": True,
},
)
async def get_thing(thing_id: Annotated[str, "The ID to fetch."]) -> dict:
"""One-line summary. Document the data source, its update cadence,
and the return shape here — the model reads this docstring."""
return await fetch_json(f"https://api.example.gov/things/{thing_id}")Paso 2 — conéctalo en tools/__init__.py:
from example_server.tools import example_tool, my_tool
def register_tools(mcp) -> None:
example_tool.register(mcp)
my_tool.register(mcp) # ← add this linePaso 3 — añade cualquier clave de API como campo tipado en config.py y documenta la variable de entorno en .env.example.
Los prompts (prompts/) y los recursos (resources/) siguen exactamente el mismo patrón de register(mcp) + agregador.
Renombrar el paquete
Antes de publicar tu servidor, renombra example_server a tu servicio (por ejemplo, census_mcp):
Renombra la carpeta
src/example_server/→src/<your_name>/.Actualiza
pyproject.toml: el[project].name,[project.scripts]y[tool.hatch.build.targets.wheel].packages.Busca y reemplaza
example_serverensrc/,tests/,main.py,Dockerfileymanifest.yaml.
Consejos de diseño de herramientas (datos federales)
Devuelve datos estructurados, no prosa. Devuelve diccionarios/listas con claves consistentes y deja que el modelo narre.
Documenta la frescura. Los conjuntos de datos federales van con retraso; indica la frecuencia de actualización y la fecha "as-of" en el docstring.
Expón la paginación. Usa
PaginationParams/paginate()deutils.py, y devuelvehas_more/next_offset.Usa tiempos de espera explícitos.
utils.fetch_jsontiene un valor predeterminado de 30s.Errores accionables. Devuelve un diccionario de error con un
hint, no un stack trace crudo.
Despliegue
El desarrollo local usa stdio. Para compartir tu servidor con una plataforma de agentes, despliégalo y regístralo. Consulta deploy/README.md para un selector, luego:
IBM watsonx Orchestrate — deploy/ibm/ (tres kits: toolkit local stdio, Code Engine build-from-Git e imagen preconstruida).
Databricks Apps — deploy/databricks/.
Ambos leen el mismo código de servidor; app.py sirve HTTP automáticamente cuando la plataforma inyecta un puerto.
Evaluaciones
Medir qué tan bien un LLM puede usar tus herramientas es la verdadera prueba de la calidad del servidor. Esta plantilla intencionalmente no incluye un marco de evaluación — consulta eval/README.md para saber cómo construir uno con la habilidad mcp-eval.
Licencia
MIT. Consulta SECURITY.md para la política de divulgación de vulnerabilidades y las notas de seguridad del hackathon.
Available Tools
1 toolexample_search_datasetsSearch Datasets (example)BRead-onlyIdempotent
Search federal datasets matching a query string. (STUB — replace me.)
This stub shows the shape of a real tool without calling a live API.
Swap the body for an actual request using fetch_json(...); a worked
pattern is included below in a comment.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Keywords to search dataset titles and descriptions. | |
| pagination | No | Optional limit/offset (defaults to limit=20, offset=0). | |
| response_format | No | Return machine-readable JSON (default) or human-readable Markdown. | json |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations (readOnlyHint, openWorldHint, idempotentHint, destructiveHint: false) already establish the safety profile. The description adds one meaningful behavioral fact—'This stub... without calling a live API'—which is honest and useful context. However, it doesn't elaborate on return behavior, result ordering, or error conditions, leaving most of the behavioral burden on the annotations. No contradiction with the annotations is present.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The text is short and front-loads the meaningful description, which is good. However, roughly three of four lines are implementer-facing stub notes ('(STUB — replace me.)', 'Swap the body...', 'a worked pattern is included below in a comment') that add no value to an agent selecting or invoking the tool. It's not verbose, but those sentences could earn their place better with functional detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, return values don't need explanation. The schema plus annotations cover the mechanical calling contract well. However, the description leaves open real-world questions an agent might face, such as what 'federal datasets' covers, and pagination behavior. For an explicitly stubbed example tool, this is adequate, but not complete for a production tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the schema thoroughly documents all three parameters: the required 'query', the pagination object with limits and defaults, and the response_format enum with its default. Per calibration rules, the baseline is 3 when the schema covers everything. The description itself adds no parameter-level insight, which is acceptable at this coverage level.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening sentence 'Search federal datasets matching a query string' uses a specific verb and resource, so an agent immediately knows what the tool does. The remaining stub text is implementer-oriented but does not obscure the purpose. It earns a 4 because it's clear on function, though the nonsensical stub placeholder text prevents a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives, what input it expects conceptually (beyond schema), or any prerequisites or limitations. The stub text discusses implementation ('Swap the body for an actual request') rather than agent-facing usage. While the absence of sibling tools lowers the need for differentiation, the description still provides no real usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
example_search_datasets
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap. The sole tool has a clear, singular purpose.
With a single tool, there is no inconsistency in naming conventions. The name follows a verb_noun pattern (search_datasets).
A single stub tool is a trivial surface for a server, far below the typical 3-15 tool range. It does not constitute a meaningful tool set.
The server is explicitly a stub with no real functionality, offering only a placeholder search. It has no coverage of any actual domain or workflow.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Create guides as MCP servers to instruct coding agents to use your software (library, API, etc).
MCP server for generating rough-draft project plans from natural-language prompts.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA basic MCP server template that provides a foundation for building custom tools, resources, and prompts. Serves as a starting point for developers to create their own MCP server functionality.-
- FlicenseNot gradedqualityDmaintenanceA foundational template for building MCP servers in Python using Streamable HTTP transport. Provides example implementations of tools, resources, and prompts to help developers create custom MCP integrations for AI assistants.-
- AlicenseNot gradedqualityDmaintenanceA minimal template MCP server demonstrating basic tools, resources, and prompts functionality. Includes example implementations like a hello tool, history resource, and greet prompt for learning MCP development.0ISC
- FlicenseNot gradedqualityDmaintenanceEducational example of an MCP server built with FastMCP, demonstrating how to expose tools, resources, and prompts for AI clients.-