My Late Night Model Context Protocol Wolfman Jack Dedication
Big Science Fiction goes MCP in a late night pre-dawn moment
It was a long night, and after 3 AM, I kept flashing back to American Graffiti. Maybe it was the hour—those moments when your mind reaches back. Like ultrarunning and that film, success hinges on what happens or doesn’t in the predawn hours.
I didn’t quite nail integrating Bad Science Fiction into the Claude Desktop app, but I did convert the BSF Python server to support the Model Context Protocol. Below are a few tips.
The Model Context Protocol (MCP) is a new open standard that looks very promising. I’ll cite Anthropic for the overview. It is:
…a new standard for connecting AI assistants to the systems where data lives, including content repositories, business tools, and development environments. Its aim is to help frontier models produce better, more relevant responses.
As AI assistants gain mainstream adoption, the industry has invested heavily in model capabilities, achieving rapid advances in reasoning and quality. Yet even the most sophisticated models are constrained by their isolation from data—trapped behind information silos and legacy systems. Every new data source requires its own custom implementation, making truly connected systems difficult to scale.
MCP addresses this challenge. It provides a universal, open standard for connecting AI systems with data sources, replacing fragmented integrations with a single protocol. The result is a simpler, more reliable way to give AI systems access to the data they need.
I sense this is going to be a big deal, so I’ve allowed myself this (and probably a few more) late-night road trips to check it out. I hired a new AI consultant—Claude 3.7 Sonnet—to help with my stable OpenAI consultants. Nice!
What follows are a few thoughts—nothing too in-depth. This is very much an ongoing experiment.
I spent most of the evening getting smart about Model Context Protocol. Anthropic’s documentation is a good place to start:
Model Context Protocol (MCP) - Anthropic
The first part of the evening went smoothly. Aside from a few learning curve bumps, my Claude 3.7 Sonnet consultant quickly helped me update the Bad Science Fiction Python server with two additional sets of endpoints and supporting code—about 400–500 lines in total:
One set related to MCP
One set for Claude Desktop Tools integration
The MCP is the open standard for integrating with the world, and the tools endpoints are for Claude Desktop integration, which is just one application.
The MCP-related updates went remarkably well. While I haven’t tested them against a full MCP client application yet—I have to find a good scenario—Claude Sonnet and I developed a reasonably rigorous unit test to verify the CORS (Cross-Origin Resource Sharing) service contracts, and that test passed cleanly. It was a confidence builder.
A succinct Claude Desktop Tool vs. MCP (Claude’s explanation) is provided in the Appendix.
I also tried integrating the service with Claude Desktop as a tool extension. With help from my AI consultants, I quickly updated the service to include the required endpoints from the specification. I ran some unit tests, which were less thorough than the MCP ones, but they suggested that the service side is at least roughly correct.
That said, I couldn’t fully close the loop and get it working within the Claude Desktop application. I suspect the issue lies mainly on the Claude Desktop side. It’s still in beta and evolving rapidly, and it seems like many others are running into similar integration challenges.
Last night's main goal was Model Context Protocol, but I haven’t given up on the Claude Desktop as a nice-to-have.
Edited 3/29 - Started working with:
modelcontextprotocol/python-sdk: The official Python SDK for Model Context Protocol servers and clients. See here.
Going much more smoothly, including with Claude Desktop.
Takeaways
Unit tests are used to verify the service before final integration, ensuring that it adheres to defined standards and expected behaviors.
What is Bad Science Fiction?
BSF, or Bad Science Fiction, describes a collaborative software project on GitHub. As explained in the AI Advances articles, the project is so named because its ostensible goal is to develop a story analysis tool specializing in science fiction—a tool to be developed in collaboration with Generative AI. However, it is as much an experiment on how best to leverage large language models (LLMs) to amplify software.
Appendix
Claude Desktop Tool
The Claude Desktop Tool integration is a specific feature designed to work with Claude as a desktop application. Its key characteristics:
Single-purpose endpoint: It implements a focused endpoint /claude_desktop_tool that specifically looks for a trigger phrase "A Bad Science Fiction moment" in the request.
Preset analysis: The tool automatically generates sci-fi themed sentiment anchors for analysis rather than accepting user-defined anchors.
Automatic processing: It automatically handles text window creation by splitting the input text into appropriate chunks.
Tool integration: It's designed to be invoked as a tool from Claude Desktop, providing a visualization of the analysis as its output.
pythonCopy@app.post("/claude_desktop_tool", tags=["Tools"])
async def claude_desktop_tool(request: ClaudeDesktopToolRequest):
# Check for "A Bad Science Fiction moment" trigger
# Auto-generate sci-fi themed sentiment anchors
# Process the text and perform analysis
# Return a visualization
Model Context Protocol (MCP)
The MCP additions implement a standardized API protocol for text embedding and analysis with these key characteristics:
* General-purpose API: MCP provides a standardized interface for embedding and analysis operations that any client can use.
* Multiple actions: It supports different actions through a single endpoint (/mcp), including embed_anchor and analyze.
* Structured data format: MCP defines specific request and response formats using Pydantic models that follow a standardized protocol.
* Consistent response structure: All responses follow standardized success/error patterns with consistent fields.
* Self-documenting: Includes a dedicated documentation endpoint at /mcp_api_docs.
pythonCopy@app.post("/mcp")
async def mcp_endpoint(request: Request):
# Dispatch to appropriate handler based on action
# Enforce standardized request/response formats
Key Differences
* Purpose: Claude Desktop Tool is a specialized integration for a specific application, while MCP is a general-purpose API protocol.
* Flexibility: MCP is designed for a variety of clients to use through a standardized interface, whereas the Claude Desktop Tool is purpose-built for one specific use case.
* Protocol vs. Feature: MCP represents an API protocol standard, while the Claude Desktop Tool is a specific feature implementation.
* Standardization: MCP follows strict standardized formats for requests and responses, making it suitable for integration with various client applications that understand the protocol.
In summary, the Claude Desktop Tool is a specific feature implementation tailored for Claude's desktop application, while the MCP additions implement a standardized protocol for text analysis that can be used by any compatible client.