{"_id":"@agentico/mcp-intent-based-demo","_rev":"2-0a86c535de703a90971122d85d70d823","name":"@agentico/mcp-intent-based-demo","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@agentico/mcp-intent-based-demo","version":"1.0.0","keywords":["mcp","intent","engine","tool","ai","agent","Model Context Protocol","workflow","automation"],"author":{"name":"Adrian Escutia"},"license":"MIT","_id":"@agentico/mcp-intent-based-demo@1.0.0","maintainers":[{"name":"adrianescutia","email":"adrian@rebelion.la"}],"contributors":[{"url":"https://escutia.me/adrian","name":"Adrian Escutia"},{"url":"https://rebelion.la","name":"La Rebelion Labs"},{"url":"https://intent-based.ai","name":"Intent Based Specs"},{"url":"https://mcp.com.ai","name":"MCP AI"}],"bin":{"ib-demo":"build/index.js"},"dist":{"shasum":"2af30f5b258fe40408c109b1205af835c57f99e9","tarball":"https://registry.npmjs.org/@agentico/mcp-intent-based-demo/-/mcp-intent-based-demo-1.0.0.tgz","fileCount":24,"integrity":"sha512-lbsvKQklf2kjW61UreU3NZ6pzEHu2JloGQZc0oz3BQHlRG4k9mjdhYnyVMHpJ6j5OoSg/4Us9mx/yGoyMuT0jA==","signatures":[{"sig":"MEUCIQCh5WRugL/Hr+1zYtNR8DDVyaiEdvuLVlGLiPzoswZ9tgIgFSRqFXIIWYPtUzb+SJcqGf5ezUSdU5yoOgcDcfQC5mU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16199},"main":"index.js","type":"module","gitHead":"b5369288f847e1034ab87eb7adc91b22f45d2c5e","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"","watch":"tsc --watch","buildup":"bunup","inspector":"npx @modelcontextprotocol/inspector@0.8.2 build/index.js","publish:npm":"npm publish --access public","prepublishOnly":"bunup && npm run build"},"_npmUser":{"name":"adrianescutia","email":"adrian@rebelion.la"},"_npmVersion":"10.9.2","description":"This is an early version of the MCP Intent-Based demo project. The goal of this project is to demonstrate how to create and manage a flexible, dynamic server environment using a declarative manifest approach. Please note that this is a work in progress an","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@agentico/mcp-intent-based":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"bunup":"^0.3.76","typescript":"^5.8.3","@types/node":"^22.14.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-intent-based-demo_1.0.0_1744681346218_0.9763129302967215","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@agentico/mcp-intent-based-demo","version":"1.1.0","main":"index.js","homepage":"https://agentico.dev","repository":{"type":"git","url":"git+https://github.com/agentico-dev/mcp.git"},"keywords":["mcp","intent","engine","tool","ai","agent","Model Context Protocol","workflow","automation"],"author":{"name":"Adrian Escutia"},"license":"MIT","type":"module","bin":{"agentico-demo":"build/index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"","watch":"tsc --watch","prepublish":"bunup && npm run build","prepare":"agentico --copy-schemas","publish:npm":"npm publish --access public","inspector":"npx @modelcontextprotocol/inspector@0.8.2 build/index.js","agentico":"npm run prepublish && npm run prepare && TOOLS_PATH=$PWD/build/tools npm run inspector"},"contributors":[{"name":"Adrian Escutia","url":"https://escutia.me/adrian"},{"name":"La Rebelion Labs","url":"https://rebelion.la"},{"name":"Intent Based Specs","url":"https://intent-based.ai"},{"name":"MCP AI","url":"https://mcp.com.ai"}],"devDependencies":{"@types/node":"^22.14.0","bunup":"^0.3.76","typescript":"^5.8.3"},"dependencies":{"@agentico/mcp-intent-based":"^0.2.0"},"_id":"@agentico/mcp-intent-based-demo@1.1.0","gitHead":"6f05d9236a3976e3d244f23767648c08cd13e01d","description":"This is an early version of the MCP Intent-Based demo project. The goal of this project is to demonstrate how to create and manage a flexible, dynamic server environment using a declarative manifest approach. Please note that this is a work in progress an","bugs":{"url":"https://github.com/agentico-dev/mcp/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-jmUPx67QTQyM+Nrd/GaIbizyb7bC6OOiohDy7RtW7m+0seZQqlnAK4sLMepFdHTGTxvd05kLoxBmFkU80OqpBw==","shasum":"5f229ee56a415144afac32ef776a631437cddf70","tarball":"https://registry.npmjs.org/@agentico/mcp-intent-based-demo/-/mcp-intent-based-demo-1.1.0.tgz","fileCount":26,"unpackedSize":21446,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEWGn68+MOQgiPNwu3NScgo+feEEpQgxwecu05aOMdX5AiBPuhnjmxmPbaol6QVpja7rMn0Nc5np4Zjc5dnwGmEmYQ=="}]},"_npmUser":{"name":"adrianescutia","email":"adrian@rebelion.la"},"directories":{},"maintainers":[{"name":"adrianescutia","email":"adrian@rebelion.la"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-intent-based-demo_1.1.0_1744995959397_0.1900974126458066"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-15T01:42:26.108Z","modified":"2025-04-18T17:05:59.784Z","1.0.0":"2025-04-15T01:42:26.434Z","1.1.0":"2025-04-18T17:05:59.592Z"},"author":{"name":"Adrian Escutia"},"license":"MIT","keywords":["mcp","intent","engine","tool","ai","agent","Model Context Protocol","workflow","automation"],"description":"This is an early version of the MCP Intent-Based demo project. The goal of this project is to demonstrate how to create and manage a flexible, dynamic server environment using a declarative manifest approach. Please note that this is a work in progress an","contributors":[{"name":"Adrian Escutia","url":"https://escutia.me/adrian"},{"name":"La Rebelion Labs","url":"https://rebelion.la"},{"name":"Intent Based Specs","url":"https://intent-based.ai"},{"name":"MCP AI","url":"https://mcp.com.ai"}],"maintainers":[{"name":"adrianescutia","email":"adrian@rebelion.la"}],"readme":"# MCP Intent Based Demo\n\nThis is an early version of the MCP Intent-Based demo project. The goal of this project is to demonstrate how to create and manage a flexible, dynamic server environment using a declarative manifest approach. Please note that this is a work in progress and may not be fully functional or stable. We welcome [feedback](https://go.rebelion.la/contact-us) to improve the project.\n\nThis guide will assist you in setting up and running the MCP Intent-Based demo project, which demonstrates how to create and manage a flexible, dynamic server environment using a declarative manifest approach.\n\n## Prerequisites\n\n- Node.js (v18 or higher)\n- `npm` or `yarn` (or `bun`)\n\n## Project Structure\n\nThe demo consists of these key files:\n\n- `server.yaml`: The manifest file that defines the server configuration\n- `src/index.ts`: The entry point that initializes the server\n- Various tool implementations as examples in the project directory\n- `src/tools/{TOOL_NAME}`: Directory containing tool implementations - one for each tool:\n  - `echo`: A tool that echoes back the input\n  - `reverse`: A tool that reverses the input string\n  - `uppercase`: A tool that converts the input string to uppercase\n  - Each tool directory MUST contain:\n    - `index.ts`: The TypeScript file for the tool implementation - MUST be named `index.ts`\n    - `schema.json`: The schema definition for the tool\n- `package.json`: The project configuration file\n\n```bash\n# tree of source directory\nsrc/\n├── index.ts  <-- Entry point for the server\n└── tools  <-- Directory containing tool implementations\n    ├── echo            <-- Tool that echoes back the input\n    │   ├── index.ts    <-- Tool implementation\n    │   └── schema.json <-- Tool schema definition\n    ├── reverse         <-- Tool that reverses the input string\n    │   └── index.ts    <-- On porpose, doesn't have a schema.json; inline with the code\n    └── uppercase       <-- Tool that converts the input string to uppercase\n        ├── index.ts\n        └── schema.json\nserver.yaml  <-- Manifest file with server intent definition\n```\n\n**NOTE**: Since TypeScript doesn't copy non-TypeScript files by default, you'll need to add a step to your build process to copy the `schema.json` files from the `src/tools/{TOOL_NAME}` directories to the `build/tools/{TOOL_NAME}` directories. You can do this using a script in your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"tsc\",\n    \"prepare\": \"agentico --copy-schemas\",\n  }\n}\n```\n\nAgentico provides a tool to facilitate this process. The `--copy-schemas` option will copy the `schema.json` files from the `src/tools/{TOOL_NAME}` directories to the `build/tools/{TOOL_NAME}` directories.\n`prepare` runs automatically when you install or publish the package and runs AFTER \"prepublish\".\n\nThis will ensure that the `schema.json` files are copied to the `build/tools` directory after the TypeScript compilation.\n\n## Getting Started\n\n### Step 1: Clone the Repository\n\n```bash\ngit clone https://github.com/agentico-dev/mcp.git\ncd mcp/mcp-intent-based-demo\n```\n\n### Step 2: Install Dependencies\n\n```bash\nnpm install\n# or\nyarn install\n```\n\n### Step 3: Understanding the Manifest File\n\nThe `server.yaml` file is the heart of the MCP Intent Based approach. It defines:\n\n```yaml\napiVersion: agentico.dev/v1\nkind: Server\nmetadata:\n  name: demo-mcp\n  description: Demo MCP Server instance\n  transport: stdio\n  capabilities:\n    - logging\n    - tools\nspec:\n  template:\n    metadata:\n      scope: local\n    spec:\n      tools:\n        - name: echo\n          description: 'Utility tool that returns the exact input provided to it...'\n        - name: reverse\n          description: 'Text manipulation tool that reverses the order of characters...'\n        - name: uppercase\n          description: 'String transformation utility that converts all alphabetic characters...'\n```\n\nThis file specifies:\n- Server metadata - to define the MCP server instance\n- Transport type (`stdio` in this example)\n- Enabled capabilities\n- Tools to be dynamically created\n\n### Step 4: Understanding the Server Initialization\n\nThe entry point of the application (`index.ts`) is remarkably simple:\n\n```typescript\n#!/usr/bin/env node\n\nimport createServerFromFile from \"@agentico/mcp-intent-based\";\n\nasync function startServer() {\n  const server = await createServerFromFile();\n  // Yes, that's all you need to do to start the server with Agentico and Intent Based AI!!\n  // server.yaml dictates the tools to be created\n}\n\nstartServer().catch((error) => {\n  console.error(\"Error starting server:\", error);\n  process.exit(1);\n});\n```\n\n🪄 The magic happens with a single call to `createServerFromFile()`, which reads the manifest file and dynamically sets up the entire server environment!!\n\n### Step 5: Running the Demo\n\nTo start the server:\n\nWe have prepared a script in the `package.json` file for you to run the demo with inspector.\n\n```bash\nnpm run agentico\n# or\nyarn agentico\n```\nIf you are using the default parameters, the MCP Inspector will be available at http://127.0.0.1:6274\n\nIf you want to do it manually, you can run the following commands:\n\n**NOTE: Make sure you add the `tools` path to the `TOOLS_PATH` environment variable, so that the server can find the tools.**\n\n```bash\nnpm run build\nTOOLS_PATH=$PWD/build/tools npm run inspector\n# or\nyarn build\nTOOLS_PATH=$PWD/build/tools yarn inspector\n```\n\nYou should see output indicating that the server has started successfully.\n\n### Step 6: Testing the Tools\n\nThe demo includes three tools:\n\n1. **Echo Tool**: Returns exactly what you send to it\n2. **Reverse Tool**: Reverses the order of characters in a string\n3. **Uppercase Tool**: Converts text to uppercase\n\nYou can interact with these tools through the configured transport (stdio in this case) via the `inspector`.\n\nExample interaction:\n\n```\n> {\"tool\": \"echo\", \"input\": \"Hello, MCP Intent Based Server!\"}\n< {\"output\": \"Hello, MCP Intent Based Server!\"}\n\n> {\"tool\": \"reverse\", \"input\": \"Hello, MCP Intent Based Server!\"}\n< {\"output\": \"!revreS desaB tnetnI PCM ,olleH\"}\n\n> {\"tool\": \"uppercase\", \"input\": \"Hello, MCP Intent Based Server!\"}\n< {\"output\": \"HELLO, MCP INTENT BASED SERVER!\"}\n```\n\n### Step 7: Extending the Demo\n\nYou can extend this demo by:\n\n1. **Adding New Tools**:\n   - Create a new tool implementation in the `src/tools` directory\n   - Add it to the `tools` section in `server.yaml`\n\n3. **Changing Transport**:\n   - Modify the `transport` field in `server.yaml`\n   - Configure the new transport as needed: \n     - `stdio` for standard input/output\n     - `sse` for server-sent events\n     - `http` for HTTP transport\n     - Custom transports can be implemented as needed\n       - `grpc` for gRPC transport - coming soon\n       - `http` for HTTP transport - coming soon\n\n## Understanding the Intent-Based Approach\n\nThe power of this approach comes from:\n\n- **Declarative Configuration**: Define what you want, not how to achieve it\n- **Dynamic Tool Creation**: Tools are created based on the manifest\n- **Separation of Concerns**: Server logic is separated from tool implementations\n- **Extensibility**: Easily add new tools and capabilities by updating the manifest\n\n## Common Issues and Solutions\n\n- **Tool Not Found**: Ensure the tool name in your request matches exactly what's in the manifest\n- **Server Not Starting**: Check that all dependencies are installed and the manifest file is valid\n- **Tool Not Working**: Check the implementation of the tool and ensure it's properly registered\n\n## Next Steps\n\n- Dive into the source code to understand how the server and tools are implemented\n- Explore the MCP Intent Based Server documentation for more advanced features\n- Try creating your own custom tools and incorporate them into the manifest\n- Experiment with different transport types\n- Explore the available logging capabilities for better insights\n\nFor more information, visit the [MCP Intent Based Server and Tools documentation](https://agentico.dev/docs/mcp-intent-based).","readmeFilename":"README.md","homepage":"https://agentico.dev","repository":{"type":"git","url":"git+https://github.com/agentico-dev/mcp.git"},"bugs":{"url":"https://github.com/agentico-dev/mcp/issues"}}