Capstone: design an MCP server for your department
اختتامی منصوبہ: اپنے محکمے کے لیے MCP سرور ڈیزائن کریں
40 min read
Three ways to see it
Step one: write the problem sentence. The same discipline as in the APIs capstone. 'Our compliance officer manually checks every new vendor against FBR, SECP, and our internal blacklist, taking forty minutes per vendor across three browser tabs.' Or 'Our audit team takes three days each quarter to reconcile NEPRA tariff PDFs against our billing system because the data lives in two formats nobody can compare quickly.' If you cannot say the sentence in one breath, your design will not survive contact with your director.
Step two: name the tools the server will expose. Three is usually right. Five is the absolute maximum for a first server. Each tool: a verb, an input schema, an output schema, and a one-paragraph description. For the vendor compliance example: check_fbr_status(ntn), check_secp_filings(cuin), check_internal_blacklist(name). Each tool does one job, returns a small JSON, and produces a clean log line. The model composes them. The model decides the order. Your job is only to give it good tools.
Step three: list the data sources behind each tool. For check_fbr_status, that is FBR's Online Verification Services with your existing API key. For check_secp_filings, in the absence of an API, it is a Playwright-based browser server that logs into eServices on your behalf, scoped to read-only public information. For check_internal_blacklist, it is your own SQL database, read-only. Each data source has an owner inside your organisation, a usage policy, and a rate limit you must respect. Document these in the design doc; surprises here turn into incident reports later.
Quick check
Quick check: what makes modern AI different from a rule-based program?
The why-tree
Why-tree level one: why a written design before any code? Because cross-functional decisions, legal, security, operations, and finance, depend on a stable artefact they can all read in the same week. Code reviews come later; the design review comes first.
Try this with Claude
AI-edge prompt to try with Claude or ChatGPT: 'I am drafting an MCP server design for vendor compliance at a Lahore-based bank. Critique my draft and return: seven concrete weaknesses ranked from most likely to kill the pilot to least, each with the one sentence I should add or remove. Then write the executive summary the board will read first, six lines, half English half Urdu.' Iterate three times.
Sources
Sources and further reading. MCP specification (modelcontextprotocol.io). Official servers (github.com/modelcontextprotocol/servers). Anthropic 'Build your first MCP server' tutorial (docs.anthropic.com). PDPA-2023 controller and processor obligations (na.gov.pk). FBR Online Verification Services (fbr.gov.pk). SECP eServices (secp.gov.pk). Playwright MCP server (github.com/microsoft/playwright-mcp).