SKILLπ JOURNAL ↗ Tutorials

Build a first MCP tool: fixtures, testing and a reproducible handoff

Start with a synthetic gallery query, separate protocol testing from answer quality, and let a second maintainer reproduce the result. Distinguish package distribution, remote hosting and registry metadata before release.

Complete one fixture-based loop before connecting real systems

A fictional cultural center wants an assistant to answer questions about gallery opening hours. The first server uses three synthetic records: open, temporarily closed and unknown identifier. The goal is to start the server, discover one tool, invoke it, check the final answer and stop the process, then let a second maintainer reproduce that loop. This is more useful for a beginner than connecting several platforms at once. MCP provides a protocol for applications to exchange capabilities with external services; business logic still needs implementation. Ordinary APIs can also be integrated, and MCP does not create safe permissions automatically. This guide covers building, testing and integration. Dependencies were not installed, a server was not run and no package was published for this article.

Scenario one: specify outputs before choosing a scaffold

Define one gallery query: an identifier goes in; name, status, opening note and data revision come out. Exclude arbitrary paths, URLs, database statements, schedule changes and staff information. Write expected results for open, closed and unknown records before code. Unknown is not service failure, and temporarily closed is not missing. Choose a language the team can maintain with a documented SDK, and pin runtime, dependencies and protocol references. TypeScript and Python are common options, not the only ones. A framework's hosting pattern is not a protocol requirement. Choose local stdio or remote HTTP from actual client support and operational needs rather than assuming every server must have a separate public URL. Create an entry point, business function, fixtures and tests. Verify matching and fields in the ordinary function first, then register the tool through the selected SDK. Keep schema, description and enforcement consistent. Read-only is still a data-access capability, so restrict the record set. Preserve dependency locking and startup notes rather than relying on the author's private paths. Prefer official MCP SDKs, quickstart-resources and reference implementations for learning because documentation and inspectable code can be checked against the version. Popularity is not a suitability test, and reference code is not production assurance. If using a generator, remove unneeded demonstration capabilities and confirm that only the intended query is exposed. Deliver a contract, synthetic records, minimal project, version list and expectation table. Mark anything not executed. A first server need not implement resources, prompts, writes and orchestration simultaneously. A small explicit surface makes misunderstandings easier to detect.

Scenario two: separate protocol tests from the final answer

Confirm the documented process starts with the expected directory and environment and can be stopped. In stdio, stdout carries protocol messages, so ordinary banners and debug text belong elsewhere, such as stderr or supported diagnostics. Do not log secrets. For HTTP, verify endpoint, transport and authentication; a webpage at the address is not proof of an MCP connection. Use a fixed Inspector version for discovery and calls, retaining actual inputs and results. Test open, closed, unknown, empty, oversized and malformed identifiers against stated expectations. Connection is not business correctness, and tool listing is not successful invocation. Simulate business failure or timeout and ensure it is distinguishable from an opening-hours response. Inspect errors for internal paths, credentials and excessive payloads. On shutdown, verify that timers and other resources are released. Results should belong to the current request and data revision, not merely contain plausible text. Then use the target client with the same questions and records. The assistant should clearly explain temporary closure and avoid inventing a gallery for an unknown identifier. If tool output is correct but the answer is wrong, inspect description, prompting and paraphrasing before rewriting the server. Keep call-level and answer-level evidence separately. Diagnose process, transport, protocol and business layers. Process failures concern command, runtime and paths; protocol failures concern versions, messages and capabilities; business failures concern identity, arguments and adapters. Language-specific debuggers help observe these layers, but a C# or Go project should not receive another language's commands blindly. Missing logs require checking the current logging mechanism, not exposing more sensitive information at random. Deliver a test matrix, reproduction steps, versions, actual results, uncovered areas and regression after repair. Inspector is a debugging tool, not certification of security, performance or every client's compatibility. A screenshot does not replace the test record.

Scenario three: make a second maintainer succeed before distribution

Hand the project to someone without the author's personal setup. Document runtime, dependencies, build, startup, client configuration, fixtures, expected results and shutdown. Configuration names and locations vary by client; do not promise every agent reads the same .mcp.json or works from an identical JSON file. Keep real credentials, private absolute paths and internal addresses out of shared examples. Explain how users provide identity in their own environment and which scope is required. Check commands, paths and permissions across operating systems. Remote execution needs its own dependency and network verification. After discovery, the second maintainer should still run the same cases. Local package distribution and remote hosting are different routes. A package needs an obtainable revision, license and execution instructions. A remote service also needs authentication, operations, logging, capacity, recovery and data boundaries. Public reachability does not authorize access to business data. No ports, accounts or production permissions were changed here. The official MCP Registry helps discovery through server metadata; registration does not host or run your code. Follow current publication documentation for namespace, referenced packages or remote information and relevant validation. It is not simply uploading source and declaring deployment complete. Discoverability also does not mean every client automatically lists, enables or trusts a server. Before release, rerun cases against the identified artifact and document ownership, feedback, version changes and retirement. After deployment, verify the actual client and environment again. If only packaging or metadata drafting occurred, state that publication did not. Registration success and a healthy process do not prove a correct answer to a user's task. Deliver a reproducible package, redacted configuration, candidate record, distribution notes and maintenance ownership. A first version can remain a team trial without public registration or real scheduling data.

A practical request

“Design one read-only MCP query over synthetic gallery records. State inputs, outputs and exclusions first. Use a fixed official SDK version, separate the business function and protocol entry, and cover open, closed, unknown, malformed and failed cases. Write instructions another maintainer can reproduce. Do not connect real systems, publish automatically or upload secrets. Distinguish execution from design in the handoff.” Continue specific authorized development within that scope while preserving evidence.

FAQ and troubleshooting

Can this be done without TypeScript? Choose a supported language the team can maintain and make its toolchain explicit. Must an entire API be exposed? No; shape a bounded task first. Why does another machine fail with the same configuration? Compare runtime, directory, paths, dependencies, environment and client support instead of widening permissions by default. Why does Inspector work while the agent selects poorly? Inspect description clarity, task fit, supported capabilities and actual invocation. Is registry publication free operation? Licensing, package hosting, remote runtime, model use and external services have separate costs. Installing a skill is not the same as running a server: procedural material and an executing service each have prerequisites and access boundaries. The current SkillPI directory search returned no verified MCP candidate, so no unrelated package is linked. Reassess future candidates by their building, debugging or integration role, source, license and dependencies rather than name similarity or an all-agent promise.

Sources and acceptance limits

Both originals cover building, testing, integration and FAQ. These remain with original gallery fixtures and a second-maintainer handoff. References are official tutorial resources, Inspector, reference implementations and Registry upstream documentation. Unsupported popularity, identical-installation, zero-cost and automatic-production claims are omitted. This guide does not claim that a real MCP service was run or published.

Share articleX ↗LinkedIn ↗