← Latest papers
💻 computer science

HarnessAPI: A Skill-First Framework for Unified Streaming APIs and MCP Tools

HarnessAPI is a Python framework that eliminates code duplication by treating typed skill folders as a single source of truth to automatically generate unified streaming HTTP endpoints, interactive OpenAPI documentation, and zero-configuration MCP tools from a single handler and Pydantic schemas.

Original authors: Edwin Jose

Published 2026-05-22
📖 4 min read☕ Coffee break read

Original authors: Edwin Jose

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a chef who has invented a delicious new recipe (a "skill"). In the world of AI and software, this recipe needs to be served to two very different types of customers:

  1. The Web Customer: They come to your restaurant's website, fill out a form, and expect a quick, formatted receipt (an HTTP endpoint).
  2. The Robot Butler: They are an AI assistant (like a digital butler) that needs to grab your recipe directly from your kitchen shelf to use it while cooking (an MCP tool).

The Problem: The "Double-Entry" Nightmare
Right now, if you want to serve both customers, you have to write your recipe twice.

  • First, you write it down in a fancy ledger for the website (using one set of rules).
  • Then, you have to rewrite the exact same instructions in a different notebook for the robot butler (using a totally different set of rules).

The paper calls this the "dual-stack" problem. The worst part is that if you change an ingredient in your kitchen (update your code), you have to remember to update both ledgers. If you forget, the website might say "Add 2 eggs" while the robot butler thinks "Add 2 cups of flour." This leads to confusion, errors, and a lot of extra paperwork.

The Solution: HarnessAPI
The author, Edwin Jose, created a framework called HarnessAPI that solves this by changing the rules of the game. Instead of starting with the "website" or the "robot," you start with the Skill (the recipe folder).

Think of HarnessAPI as a universal translator and printer that sits in your kitchen.

  • You put your recipe in a single folder with one set of instructions.
  • HarnessAPI looks at that folder and automatically prints out the "Website Receipt" and the "Robot Instruction Sheet" for you.
  • Because both sheets come from the same master folder, they can never disagree. If you change the recipe, both sheets update instantly.

How It Works (The Magic Tricks)

  • One Folder, Two Doors: The framework treats a folder containing your code as the "Source of Truth." It automatically builds a door for the web and a door for the robot, so you never have to build them manually.
  • The Shape-Shifting Waiter: Imagine a waiter who can change their uniform based on who is asking. If a web browser asks for data, the waiter serves it as a standard JSON file. If an AI agent asks for a stream of data (like a video playing in chunks), the waiter instantly switches to a streaming mode. The waiter (your code) doesn't even know they are changing; the framework handles the switch automatically.
  • The "Fake" Robot: To make the robot butler understand your code, the framework creates a special "wrapper" (a translator) on the fly. It's like the framework quickly writing a note that says, "Hey Robot, here is exactly how to call this function," so the robot doesn't get confused by complex code structures.

Why It Matters (The Results)
The author tested this by building six different "skills" (like summarizing text or translating languages) in two ways:

  1. The Old Way: Manually writing the code for the website and the robot separately.
  2. The HarnessAPI Way: Just writing the skill once.

The Findings:

  • 74% Less Work: The HarnessAPI method required 74% less "boilerplate" code (the boring, repetitive setup work).
  • No Drift: In the old way, the two versions could drift apart and become inconsistent. In the new way, they are mathematically guaranteed to be identical because they come from the same source.
  • One Process: Instead of running two separate servers (one for the web, one for the robot), HarnessAPI runs everything in one single process, making it lighter and easier to manage.

The Catch (Limitations)
The paper is honest about a few safety rules:

  • The "Hot-Swap" Feature: There is a feature that lets you update the code while the server is running (great for testing), but the author warns this is like giving someone a remote control to your kitchen. It is only safe to use on your own computer (localhost) and should never be turned on for public websites, or hackers could take over your server.
  • Complexity: It works great for standard recipes, but if your recipe involves extremely complex, nested structures, the automatic translator might need a little help.

In Summary
HarnessAPI is a tool that stops developers from doing double work. It says, "Write your code once, and we will handle the rest." It ensures that your AI tools and your web tools are always in perfect sync, saving time and preventing the errors that happen when you try to maintain two separate versions of the same thing.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →