{"_id":"@abdur008/mcp-agent-protocol","name":"@abdur008/mcp-agent-protocol","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@abdur008/mcp-agent-protocol","version":"1.0.0","description":"Model Context Protocol (MCP) action catalog, TOON token compressor, and bidirectional context serializer for AI agent-driven web workspaces.","author":{"name":"Blueprinto Team"},"license":"MIT","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","test":"bun test","typecheck":"tsc --noEmit"},"keywords":["mcp-protocol","ai-agent","model-context-protocol","toon-format","token-compression","workspace-agent","llm-tools"],"dependencies":{"@toon-format/toon":"^2.1.0"},"devDependencies":{"@types/bun":"latest","@types/node":"^20.17.0","tsup":"^8.3.6","typescript":"^5.7.3"},"gitHead":"814d31f9c0e1f3bfd79eb98b6b98a91d7255282f","_id":"@abdur008/mcp-agent-protocol@1.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-SYa6YnbX0wGz47Qqi1fEyXwDRNFWyEJVUjSU1I8HfhO/44RA/c+zT2lV1oUWkalOyQSZW+BEAKaHZzakQUd+1Q==","shasum":"4a6596c3da733d6b622aa6bcb5a179ddf47aab49","tarball":"https://registry.npmjs.org/@abdur008/mcp-agent-protocol/-/mcp-agent-protocol-1.0.0.tgz","fileCount":8,"unpackedSize":45101,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAwWIFyMwlqTXok9ndvb0rmMxO+LtEEVMqkP+Cr5T8LnAiEA26/gMGZyDGTGNTLvIYhNYp08XtcmwmeNsfzOBTKt0WM="}]},"_npmUser":{"name":"abdur008","email":"abdurfreelance@gmail.com"},"directories":{},"maintainers":[{"name":"abdur008","email":"abdurfreelance@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-agent-protocol_1.0.0_1786824305749_0.3707061527806208"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T20:05:05.588Z","1.0.0":"2026-08-15T20:05:05.899Z","modified":"2026-08-15T20:05:06.129Z"},"maintainers":[{"name":"abdur008","email":"abdurfreelance@gmail.com"}],"description":"Model Context Protocol (MCP) action catalog, TOON token compressor, and bidirectional context serializer for AI agent-driven web workspaces.","keywords":["mcp-protocol","ai-agent","model-context-protocol","toon-format","token-compression","workspace-agent","llm-tools"],"author":{"name":"Blueprinto Team"},"license":"MIT","readme":"# @abdur008/mcp-agent-protocol\n\nModel Context Protocol (MCP) action catalog, TOON token compressor, and bidirectional context serializer for AI companion agents driving web UI workspaces.\n\n## Installation\n\n```bash\n# Using bun\nbun add @abdur008/mcp-agent-protocol\n\n# Using npm\nnpm install @abdur008/mcp-agent-protocol\n```\n\n## Features\n\n- **Standardized Action Catalog:** Declarative specifications for UI navigation actions (`open_component`, `open_tool`, `open_split_view`, `switch_tab`, `move_entity_to_slot`).\n- **Runtime Validation:** Validates and deserializes tool call responses from AI models with error tracking.\n- **TOON Token Compression:** Automatically compresses JSON context payloads to TOON (Token-Oriented Object Notation) to reduce token costs and latency when communicating with LLMs.\n- **Workspace Context Serializer:** Compact representation of active items, panels, tools, and anchor budgets for prompt injection.\n\n## Quick Start\n\n### 1. Serializing Workspace Context for LLM Prompts\n\n```typescript\nimport { serializeWorkspaceContext } from \"@abdur008/mcp-agent-protocol\";\n\nconst snapshot = {\n  viewKind: \"single\" as const,\n  activeItemId: \"comp-1\",\n  activeItemKind: \"ring_component\" as const,\n  totalAnchorsCount: 4,\n  maxAnchorsAllowed: 10,\n  availableTools: [\"comments\", \"tasks\", \"history\"],\n  visibleItems: [\n    { id: \"comp-1\", title: \"STEM Lab\", kind: \"ring_component\" as const },\n    { id: \"comp-2\", title: \"Humanities\", kind: \"ring_component\" as const },\n  ],\n};\n\nconst encoded = serializeWorkspaceContext(snapshot);\nconsole.log(\"Format used:\", encoded.format); // \"toon\" or \"json\"\nconsole.log(\"Context String:\", encoded.content);\n```\n\n### 2. Validating & Executing AI Tool Intent\n\n```typescript\nimport { parseActionEnvelope } from \"@abdur008/mcp-agent-protocol\";\n\nconst aiResponse = JSON.stringify({\n  kind: \"open_component\",\n  targetId: \"comp-1\",\n  mode: \"expanded\",\n});\n\nconst action = parseActionEnvelope(aiResponse);\nif (action) {\n  console.log(\"Valid action:\", action.kind, \"Target:\", action.targetId);\n  // Dispatch to your UI store (e.g. Zustand, Redux, or React state)\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-f63962d9b99d02ebf29a1e6f2aa8c2e7"}