Building Your Own MCP Server for AI
Capstone
Build, deploy, connect, and test a production-style MCP server — a checklist you can reuse.
Ship one server that a second person could enable without a screen share. You may reuse httpbin, GitHub, or an API you already run. The grade is the checklist, not the brand of backend.
Build
- Python 3.10+ venv,
mcp[cli]>=2,<3pinned,server.py(or a package) withMCPServer. - At least two tools that match jobs, not raw paths. Structured
ok/errorresults. - At least one resource or one prompt — you choose which fits the product.
- Secrets from the environment only. No tokens in git.
- A README: what the tools do, how to run stdio, how to run HTTP.
Connect
- A host config (Cursor or Claude Desktop) that starts stdio with the venv Python.
- A recorded chat (screenshot or gist) where the model called a tool and used the result.
Deploy
- Process manager on a VM or equivalent (container is fine).
- HTTPS URL or a documented reason you stayed on stdio-only (laptop personal server).
- If remote: bind locally, proxy, no open app port.
Test
- Happy path for each tool.
- Validation failure (empty required field) returns JSON, not a stack trace.
- Missing secret returns a clear
ok: false. - A destructive tool, if any, requires confirmation. If none, write that you omitted deletes on purpose.
Done
When every box is honest, you have a production-style MCP server: small surface, boring transport, secrets out of band. Start the next API from Build a Useful MCP Server, not from the OpenAPI file.
Course hub: Building Your Own MCP Server for AI.