hermes

Build an MCP server

Implements a Model Context Protocol server exposing the given tools and resources, with input validation, least privilege and error messages a model can act on. Use to connect a system to AI clients.

context

An MCP server lets any MCP client (coding agents, chat apps, IDEs) call your tools and read your resources. The model decides the arguments, so every input is untrusted, including inputs that came from a prompt injection in some document the model read earlier. Servers commonly break in a few ways: on stdio, anything written to stdout that is not a protocol message corrupts the session; handlers throw raw exceptions, so the model sees a generic failure and retries blindly; file tools accept ../ paths; database tools accept raw SQL; HTTP servers listen on every interface without checking origin or authentication; and one broad admin token is shared by every tool.

task

Implement an MCP server in over for:

  1. Restate each tool and resource as a table: name, inputs, output, side effects, the external system and the credential it uses. If the spec is ambiguous in a way that changes behaviour or privileges (which directory, which database role, whether writes are allowed), ask before writing code.
  2. Use the official MCP SDK for at its current major version. If you are not sure of an exact API in that version, check the SDK's README or type definitions rather than guessing, and list what you assumed.
  3. For every tool:
  • declare the input schema with types, enums, bounds and descriptions written for the model;
  • set the tool annotations honestly (read-only, destructive, idempotent, open-world);
  • validate beyond the schema in the handler: resolve paths and reject anything outside the allowed root, use parameterised queries, check identifiers against allowlists, and cap sizes and counts;
  • return results as concise text or structured content, truncating large outputs and saying how to get the rest;
  • on failure, return a tool result marked as an error, with a message that tells the model what to change, for example "path must be inside notes/; got ../etc/passwd". Never return stack traces, secrets or internal hostnames.
  1. Expose resources with stable URIs if the spec includes read-only data.
  2. Apply least privilege: read configuration and secrets from environment variables, use read-only credentials for read-only tools, allowlist roots, hosts and tables, and put timeouts on every outbound call.
  3. Transport. stdio: write logs to stderr only. http: use Streamable HTTP, bind to 127.0.0.1 by default, validate the Origin header, require authentication for anything that is not strictly local, and note that the MCP specification defines OAuth-based authorization for remote servers.
  4. Write tests for input validation and error paths at minimum, a README with the environment variables and a client configuration snippet, and how to try the server with the MCP Inspector.
  5. If you can run commands, install, build and run the tests, and report the real output. If you cannot, say that nothing was run.
constraints
  • Implement only the tools and resources in the spec. Suggest extra ones in one line under Assumptions.
  • No shell execution with interpolated input. If the spec asks for arbitrary command execution, raw SQL or unrestricted file writes, explain the risk and propose a narrower tool (an allowlist of commands, named queries, a sandboxed directory) before implementing anything broader.
  • Pin the SDK's major version in the manifest.
  • Do only what was asked. If you notice something else worth changing, mention it in one line at the end instead of changing it.
  • Keep the change as small as it can be while still being correct.
output format

Plan

The tools and resources table, with the privilege each one needs.

Files

Each file in its own fenced block, preceded by its path.

Run and test

Commands to install, build, test and connect a client, plus the real test output or "Not run".

Security notes

What each tool can reach, what the validation blocks, and the remaining risks.

Assumptions

SDK details, spec interpretations and suggested additions.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
AI and ML engineering
level
Intermediate
made for
Software engineer, Backend engineer, ML / AI engineer
needs
file-write
risk
edits-files
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install build-mcp-server --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill build-mcp-server -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

PromptAI and ML engineering

Design tool definitions for an LLM agent

Designs tool or function definitions for an LLM agent, with names, descriptions, JSON Schema parameters and error returns that models call reliably. Use when exposing an API or capability to an agent.

design-tool-schema
PromptAI and ML engineering

Build an LLM structured extraction step

Builds an LLM step that turns documents into schema-valid JSON, with the schema, prompt, validation and repair loop, null handling and an eval set. Use when automating invoices, forms or emails.

build-structured-extraction
PromptAI and ML engineering

Choose between rules, ML and an LLM

Recommends rules, classical ML, a hosted LLM or a fine-tuned model for a problem, comparing accuracy, cost, latency and maintenance with the reasoning shown. Use before committing to an approach.

choose-ml-approach
PromptAI and ML engineering

Design an LLM agent architecture

Designs an LLM agent system, deciding first whether an agent is needed, then single or multi-agent, tools, memory, guardrails, human checkpoints, evals and cost limits.

design-agent-architecture
PromptAI and ML engineering

Design a RAG pipeline

Designs a retrieval-augmented generation pipeline from a corpus and its real questions, covering chunking, hybrid retrieval, reranking, citations and evals. Use before building or rebuilding RAG.

design-rag-pipeline
PersonaAI and ML engineering

Machine-learning engineer

Acts as a machine-learning engineer who starts from the data and a baseline, insists on evals and reproducibility, and distrusts any gain a simpler model explains.

ml-engineer