HarnessAPI: A Skill-First Framework for Unified Streaming APIs and MCP Tools
Edwin Jose · 2026
Read HarnessAPI: A Skill-First Framework for Unified Streaming APIs and MCP Tools by Edwin Jose (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-22733.txt.
Introduction
Jose presents HarnessAPI, a Python framework that ends the double maintenance of language model tools as both HTTP endpoints and MCP tool registrations. From one typed skill folder with a handler and Pydantic schemas, it derives a streaming HTTP endpoint, an interactive API interface, and a zero configuration MCP tool in a single process. Dual mode negotiation serves streaming and plain JSON clients from the same handler without changes. Across six sample skills, it cuts framework facing boilerplate by 74 percent against a hand maintained FastAPI plus FastMCP dual stack.
Catalog record
| CREATOR | Edwin Jose |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 33977 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.22733
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
HarnessAPI: A Skill-First Framework for Unified Streaming APIs and MCP Tools Edwin Jose Abstract Every Python function deployed as an LLM tool must today exist in two forms: an HTTP endpoint for human-facing clients and CI pipelines, and an MCP tool registration for agent runtimes such as Claude and Cursor. These representations share business logic yet diverge in all the surrounding machinery (routing, validation, serialisation, streaming, and schema maintenance), and they drift apart as the underlying code evolves. We present HarnessAPI , a Python framework that eliminates this duplication by treating a typed skill folder as the single source of truth. From one handler.py plus Pydantic schemas, the framework automatically derives a streaming HTTP endpoint with Server-Sent Events, an interactive OpenAPI/Swagger UI, and a zero-configuration MCP tool, all served from a single process. Dual-mode content negotiation lets the same handler serve SSE-streaming and JSON-returning clients with no handler changes. A dynamic code-generation mechanism ensures Pydantic type annotations propagate correctly to FastMCP’s inspection layer, resolving a technical limitation that prevents naive closure-based registration. Measured across six representative skills using cloc , HarnessAPI reduces framework-facing boilerplate by 74% compared with a manually maintained dual-stack implementation (FastAPI server + + FastMCP server). HarnessAPI subclasses FastAPI, inheriting its full middleware, dependency-injection, and deployment ecosystem. It is available at https://github.com/edwinjosechittilappilly/harnessapi and on PyPI ( pip install harnessapi ). Keywords Model Context Protocol \cdot FastAPI \cdot LLM Agents \cdot Streaming APIs \cdot Server-Sent Events \cdot Framework Design \cdot Skill-First Architecture \cdot MCP Tools 1 Introduction Tool use sits at the heart of modern LLM agent design. Frameworks from ReAct ( 20 ) to AutoGen ( 17 ) treat tools as the primary mechanism through which agents act on the world, and surveys of autonomous agent architectures identify tool invocation as the central action module connecting language models to external systems ( 16 ; 18 ) . The practical question those surveys leave open is how a developer should deploy a capability so that it is reachable from all the places that matter: agent runtimes that speak MCP, web dashboards that speak HTTP, and CI pipelines that speak both. Today that question has an uncomfortable answer. The Model Context Protocol ( 3 ; 9 ) , adopted across Claude Desktop, Cursor, GitHub Copilot, and a growing registry of agent runtimes (catalogued in ( 4 ) ), defines how agents discover and invoke tools. HTTP REST endpoints, served by asynchronous frameworks evaluated empirically in ( 2 ) , define how everything else invokes them. The two interfaces share business logic but not infrastructure: Patil et al. showed that LLMs hallucinate API calls when type schemas are absent or stale ( 12 ) , yet maintaining two parallel schema definitions (one in Pydantic for the HTTP layer, one in MCP tool registration for the agent layer) is precisely the condition most practitioners find themselves in. Mastouri et al. confirmed empirically that 88.6% of MCP servers are backed by existing REST services ( 8 ) , meaning the vast majority of deployments already carry this dual-maintenance burden. The root cause is architectural: neither FastAPI nor FastMCP treats the skill as a first-class entity. FastAPI is route-first: the route decorator is the registration act, so adding MCP exposure requires a separate, parallel registration. FastMCP is tool-first but knows nothing about HTTP. The developer must stand in the middle and keep both definitions in sync. HarnessAPI resolves this by inverting the dependency. The skill folder, a directory containing a typed handler and a Pydantic schema, is the authoritative definition; the HTTP endpoint and the MCP tool are derived from it. This is not merely a scaffolding convenience: the inversion enforces a structural invariant (the handler and both transport registrations share the same schema) that manual dual-stack maintenance cannot guarantee. The framework subclasses FastAPI and mounts FastMCP as an ASGI sub-application, so the dual-stack exposure comes with no performance or ecosystem penalty. The contributions of this paper are as follows. We define the skill-first architecture pattern, characterise its invariants, and contrast it with the route-first and tool-first patterns it replaces ( section 3 ). We describe the non-trivial implementation mechanisms that make the pattern work in practice: dynamic route generation, dual-mode content negotiation, a code-generation technique that correctly propagates Pydantic annotations into FastMCP’s inspection layer, and the lifespan-merging strategy required for single-process operation ( section 4 ). We evaluate the framework against manually maintained dual-stack implementations across six skills using a repeatable cloc -based methodology, finding a 74% reduction in framework-facing boilerplate with full feature parity ( section 5 ). We also discuss the security implications of the optional handler hot-swap endpoint and the exec -based MCP wrapper, with concrete deployment guidance ( section 6 ). Scope. This paper describes the design and open-source release of HarnessAPI v0.1.4. We evaluate boilerplate reduction and feature parity; end-to-end latency and concurrency benchmarks are left to future work, consistent with the scope of framework description papers ( 14 ) . 2 Related Work 2.1 LLM Tool Use and API Grounding The ReAct pattern ( 20 ) established interleaved reasoning and tool invocation as the dominant LLM-agent execution model. Subsequent work scaled this to thousands of real-world APIs: ToolLLM ( 13 ) built a benchmark of 16,000+ REST APIs with automatic instruction tuning, while Gorilla ( 12 ) demonstrated that hallucinated API calls drop sharply when the model is grounded in accurate, typed schemas. Gim et al. ( 5 ) further show that asynchronous function-calling pipelines can reduce end-to-end latency by 1.6–5.4 \times relative to synchronous equivalents, establishing that the deployment architecture around tool calls is as performance-critical as the calls themselves. The implication for HarnessAPI is direct: schema staleness between an HTTP layer and an MCP layer is not merely inconvenient; it is a reliability hazard that the skill-first architecture eliminates structurally. 2.2 Agent Frameworks and Tool Abstraction Xu et al. ( 19 ) trace the evolution of tool use in LLM agents from single-tool calls through multi-tool orchestration, surveying frameworks including LangChain, AutoGen, and CrewAI. A common pattern across these frameworks is that tool objects are agent-internal: they wrap Python callables for reasoning pipelines but are not natively exposed as HTTP services or MCP tools. Exposing LangChain tools as HTTP services, for instance, requires LangServe, a separate deployment layer that adds its own routing conventions atop the framework, meaning two registration acts still exist for each capability. The Lewis et al. RAG paper ( 6 ) and data-retrieval frameworks that implement it (such as LlamaIndex) face the same tension: the retrieval pipeline is an agent-internal object, and making it callable from an MCP client or a REST client requires a separate adapter. AutoGen ( 17 ) models agents as conversational participants that register tools via function decorators; it provides no native HTTP exposure. Semantic Kernel (Microsoft) introduced the concept of a skill (now plugin ) as a named, typed capability and can expose skills over HTTP, but it is a full agent runtime rather than a deployment-layer framework, and it does not derive MCP tool registrations from the same definition. None of these frameworks offer what HarnessAPI provides: a single file-system artefact from which both an MCP tool and an HTTP endpoint are derived without