Token-efficient MCP adapter for founders using Pi coding agents, backed by 1.1k+ GitHub stars.
1,050 stars219 forksTypeScriptQuality 8/10Updated 7/24/2026100% free ยท open source
What it does
The pi-mcp-adapter enables token-efficient communication between Pi coding agents and MCP servers, allowing for more efficient development and deployment of applications
Install / run
npm install pi-mcp-adapter
When to use it
โขWhen building applications that require efficient communication between Pi coding agents and MCP servers
โขWhen trying to reduce the token usage in existing applications using Pi coding agents and MCP servers
โขWhen developing applications that require low-latency and high-throughput communication between Pi coding agents and MCP servers
Quick start
1Import the adapter in your TypeScript project using `import { PiMcpAdapter } from 'pi-mcp-adapter';`
2Create a new instance of the adapter using `const adapter = new PiMcpAdapter('https://your-mcp-server.com');`
3Configure the adapter with your MCP server credentials using `adapter.setCredentials('your-username', 'your-password');`
4Use the adapter to send and receive messages with your MCP server using `adapter.sendMessage('your-message');` and `adapter.onMessage((message) => console.log(message));`
5Verify the token usage is being optimized by checking the adapter's metrics using `adapter.getTokenUsage();`
Ready-to-paste prompt
const adapter = new PiMcpAdapter('https://your-mcp-server.com'); adapter.setCredentials('your-username', 'your-password'); adapter.sendMessage('Hello, MCP server!');
Heads up: Make sure you have the correct TypeScript version installed (>= 4.5) as the adapter is built with TypeScript and may not be compatible with earlier versions