Building with MCP - Notes

Building with MCP - Notes

December 16, 2024·
Shaun Smith

The launch of Model Context Protocol was perfectly timed for me as I was beginning some tool integration work. Having now had a chance to implement a couple of Servers, I thought it was worth typing up some notes.

The info here is correct at the time of writing although things are likely to change rapidly1. If this article proves popular, I’ll keep it updated.

The Basics

MCP Inspector: Console Messages

MCP Inspector: Console Messages

  • With Claude Desktop, MCP Servers communicate over STDIO. That means console.log() is directed to your message stream which you almost certainly don’t want. Fortunately, console.error() is visible in the MCP Inspector.
  • Use the Inspector. It shortens the development feedback loop compared with Claude Desktop, and lets you see protocol message content and notifications. Kudos to the MCP team for releasing this tool intact on day one.
  • Another good starting point is the Everything Server. Its a good exercise to hook this up with the Inspector and Claude Desktop to see how everything fits together.
  • The Inspector is a small React app that communicates with target MCP servers through a proxy layer. The proxy can either spawn a new server process (STDIO mode) or connect to an existing server (SSE mode). For Node development you are going to want to point it at your build folder (dist/index.js) or equivalent. Refresh the page and reconnect to load changes.
  • At launch, Windows didn’t work with NPX. Although the initial problem was fixed, issues remain if you have NVM for Windows installed. Having typed out instructions on how to fix more than once, it made more sense to just have Claude make an install script.

Claude Desktop

MCP was released with Claude Desktop as the Client reference implementation, intended to serve as a development preview for the community. Here is a quick reference to some of the supported MCP features:

Feature Notes Images
Tools Tools are the functions that a Server provides. They appear prominently in the Chat window, and based on their descriptions Claude will use them without the need for special prompting. The protocol clearly specifies that Users must consent to operations - managed here by a popup.
Resources and Prompts Both Resources and Prompts can be attached to the conversation, with Images and PDFs being supported. Prompts appear as JSON document attachments rather than being included in the Conversation stream and non-text elements being attached separately.
Prompt Arguments If a Prompt has arguments, Claude will display a dialogue for User Input. This is basic: it doesn’t show default values, parameter description or enum options to guide the User.

The Roots and Sampling features are advertised as being unsupported.

Testing against Claude Desktop 0.71 and 0.75 have shown the following Base Protocol features are currently unsupported:

Unsupported
Feature
Notes
Resource Templates Servers can define URI templates for accessing Dynamic resources, enabling the Client to construct parameterized URIs on demand rather than listing every possible resource combination. In conjunction with Autocomplete this would enable the User to navigate large resource trees and construct valid Resource requests.
Autocomplete Provides dynamic completion suggestions to the Client for Resource Template parameters and Prompt arguments. Distinct from LLM “completions” in Sampling.
Instructions Servers can provide usage instructions intended for the LLM during initialization. Not currently supported by Claude Desktop, which only displays the server version in Tools dropdown.
Tool Change Support Claude Desktop does not handle Tool Update notifications or Tool List changes after initialization. Requires restart to detect changes.
Progress Reporting Claude Desktop does not send a progressToken or handle progress updates. Tool calls have fixed 60-second timeout, and it appears that isError in the result object is ignored. Implementing Progress Reporting can reassure the User that the Tool call hasn’t crashed, and enable long running tool calls to be cleanly supported.
Cancellations No support for Request cancellation in Claude Desktop, and no support for Servers to send a cancellation in the current SDK. In conjunction with Progress Reporting, this would let the User cancel long-running tasks if wanted.

With the Inspector being Open Source it’s easy to update and see what is/isn’t supported - the maintainers have also been quick at turning round PRs. With the proprietary Claude Desktop its trial and error - I hope the above list saves at least one person some effort2.

Of course, other Clients may implement different subsets of the protocol in different ways. I do expect that Claude Desktop will remain the reference platform for MCP integration behaviour for some time yet though. It would be welcome if Anthropic were to annotate which pieces of the Specification were implemented in Claude Desktop for the MCP Community.

I look forward to Claude Desktop implementing Roots, as a way to enable simple, easy-to-configure resource sharing between Clients and Servers.

Specification Notes

The MCP Specification contains some powerful features that are not prominently documented:

  • Audience Annotations. Resources can be annotated with a Role and Priority to indicate whether the content is intended for the User, Assistant or both. This helps both Clients and Servers decide whether Resources should be tokenized for LLM Context, or treated as attachments.
  • Model Preferences. Servers that request Sampling (an LLM Completion) can specify preferences for the cost, speed and intelligence of the model used. System Prompts can also be specified.
  • Experimental Features. Both Clients and Servers can declare experimental features, providing a clean way to enhance the protocol with features like authentication flows, content type negotiation and streaming. This also allows capability enhancement between specific Client/Server pairings.

Tool Usage

Pawmatch Guided Results

Pawmatch Guided Results

  • Sonnet 3.5 is very good at combining different Server capabilities with Sequential Tool calling. This means Claude use the output from one Tool call as the input to another. This makes Claude Desktop a powerful development environment for quickly prototyping ideas and agent workflows.
  • Tool and Parameter descriptions are important. One specific example of this is using the Pawmatch Breed Dog Breed Recommendation engine with with mcp-hfspace. Claude uses the Parameter descriptions to interactively guide the User through the 11 questions needed for a recommendation.

MCP Ecosystem

The MCP ecosystem has evolved rapidly since its preview release:

  • MCP Servers can be easily one-shot, making them ideal for quick, task-focused integrations. A local execution environment similar to Claude Artifacts would be a fun evolution of this pattern.

  • The community has embraced MCP enthusiastically, producing dozens of Community servers, directories and installation tools

  • Protocol stewardship will be crucial as the ecosystem matures. The first coordinated update across the Specification, SDK, Inspector and Reference Implementation will set important precedents, particularly as features for supporting remote servers and authentication are added.

On launch the QuickStart article was a tutorial setting up a SQLite Database. It’s been replaced now, but you can find the original here.

I hope that this set of notes and links helps people who are starting with MCP development or are looking at the protocol.


  1. Items referenced in the Specification link to specific commits - check for updated versions. At the time of writing the Protocol Revision was 2024-11-05 and Claude Desktop 0.75. ↩︎

  2. We’re not quite at the point where Computer Use could complete do this cycle…? ↩︎