> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# MCPgraphy: A Proxy That Learns Effective Tool Usage for Agents
- URL: https://www.stirup.si/mcpgraphy-a-proxy-that-learns-effective-tool-usage-for-agents-c0934414/
- Published: 2026-11-03T05:56:00.000Z
- Updated: 2026-11-03T05:56:00.000Z
- Description: MCPgraphy is a proxy that learns from agent interactions with MCP servers to warn or block ineffective tool calls, improving reliability and reducing failures.
- Author: Satish Das
- Tags: Community, News, Stirup Research

## Overview and Functionality

Show HN: MCPgraphy – a proxy that learns when your agent's MCP tools work – introduces a novel approach to improving the reliability of agent interactions with MCP servers. MCPgraphy acts as a proxy that observes the agent's calls to the server and learns, from the agent's own traffic, which tools are effective in specific states. This learning process enables MCPgraphy to warn or block potentially problematic calls before they occur, reducing the likelihood of failures. The proxy operates by analyzing the agent's interactions with the MCP server, which provides a list of tools, including names, descriptions, and parameter schemas. MCPgraphy checks whether a particular call has ever worked from a given state, a critical factor in determining success or failure in practice. By leveraging this information, MCPgraphy enhances the agent's ability to make effective tool calls without relying on prior knowledge of the server's behavior.

## Implementation and Usage

The implementation of MCPgraphy involves installing the package via `pip install mcpgraphy` and wrapping an MCP server command with the `mcpgraphy wrap` command, specifying an adapter file, policy, and target server. The `--policy` flag determines behavior: `observe` logs and learns without interference, `warn` (default) passes calls through but notes failures, and `block` prevents calls known to fail or require approval. The `--db` flag selects the SQLite database file, and `--refresh-every` sets how often the proxy relearns from new data. For quick testing, a demo script is available that runs an agent in `warn` mode, attempting to edit and move files that initially do not exist, then succeeding after corrections. This script requires Node.js for `npx` and uses the official filesystem server as a target.

## Performance and Benefits

Performance metrics from [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si) and [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si) highlight the benefits of MCPgraphy over raw MCP tools. With AALpy L\* automaton, tasks completed increased to 1.00, while invalid calls per task dropped to 1.17, showing a 1.02 reduction compared to raw tools. MCPgraphy’s passive mode achieved 0.71 tasks completed and reduced invalid calls by 1.47, while active probing further improved this to 0.67 tasks completed and 1.52 fewer invalid calls. [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si) data reveals that MCPgraphy completed 99% of achievable jobs, compared to 74% with raw tools, and correctly identified 100% of unreachable jobs, versus 86% with raw tools. It also reduced false success claims to zero, from 10 with raw tools, and cut tool calls and model turns by 5% and 5.4%, respectively. MCPgraphy’s proxy design reduced rejected calls by 60% and lowered cost per job by 7%, as measured by tokens used and job completion rates. These results suggest that MCPgraphy significantly improves efficiency and accuracy without additional requests, as noted in [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si).

## Status and Learning Mechanism

The status and learning mechanism in MCPgraphy determines how the proxy evaluates the effectiveness of an agent's MCP tools. Each state transition is categorized into one of several statuses, including OBSERVED\_SUPPORTED, CONDITIONAL, CONTRADICTED, and UNKNOWN, which map to specific agent actions such as CANDIDATE or NOT\_SUPPORTED\_FROM\_THIS\_STATE. According to [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si), OBSERVED\_SUPPORTED is only assigned when a direct observation confirms the state with no conflicting data. [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si) emphasizes that UNKNOWN statuses are never elevated without direct evidence, ensuring that decisions are grounded in observed data rather than assumptions. In its own benchmark, MCPgraphy compared its performance against a baseline automaton, as noted in [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si). At the same call budget, the automaton left the agent with 1.17 invalid calls per task, while the passive proxy achieved 0.71, highlighting the importance of state validation with evidence in real-time decision-making.

## Future Development and Roadmap

Future development for MCPgraphy includes expanding support through adapters for GitHub, Linear, Slack, and Postgres MCP servers, with an adapter init that drafts one from the tool schemas, as outlined in the roadmap ([Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si)). The proxy will also be served over Streamable HTTP and stdio, enabling broader integration. A local page will be introduced to browse the graph and audit log, enhancing transparency and usability. Additionally, approval prompts will be directed to the host instead of relying on a static --approve list, improving flexibility and control. Users interested in specific features are encouraged to open an issue to request them. These developments aim to refine the proxy's functionality and user experience while maintaining alignment with the tool's evolving requirements.

## Sources and reporting notes

- [Hacker News Show](https://github.com/hemanth1999k/mcpgraphy?ref=stirup.si)

Based on published source material. No independent hands-on testing is claimed.