This is a repository for the MCPforEXP project. The project aims to create a conversational interface for Manifold.
The project is structured to clearly separate concerns and support scalability and testing. Source code lives under src/, with backend logic divided between server functionality and LLM/MCP integration, and the UI isolated in its own directory. Tests mirror the source structure under test/, making it easy to locate and maintain test coverage alongside corresponding components. Supporting scripts are kept in scripts/ to keep automation and tooling separate from application logic. This layout was chosen to improve readability, encourage modular development, and make the system easier to extend as the MCP and LLM integrations evolve.
├── scripts/
├── src/
│ ├── backend/
│ │ ├── mcp-server/
│ │ ├── utility/
│ │ └── llm/
│ ├── mcp-client/
│ └── frontend/
├── test/
│ ├── backend/
│ │ ├── server/
│ │ ├── llm/
│ │ └── mcp/
│ └── ui/
This project comes with convenient npm scripts to manage setup, teardown, and tests.
Make sure you’ve installed project dependencies:
npm installRun the full project setup. This will install the manifold ruleset to the pico. After running the setup script you can then start the pico engine at will.
npm run setup
pico-engineThe npm run setup command runs the scripts/setup.sh script.
Stop servers and clean up any temporary processes or files:
npm run teardownThis runs the scripts/teardown.sh script.
To run the Jest test suite:
npm testOr equivalently:
npm run testThis repo includes a small adapter that normalizes all pico-engine calls (KRL queries + events) into a single JSON envelope.
Use this shape for every operation:
{
"id": "optional-correlation-id",
"target": { "eci": "ECI_HERE" },
"op": {
"kind": "query",
"rid": "io.picolabs.manifold_pico",
"name": "getThings"
},
"args": {}
}- Queries use
op.kind="query"withop.rid+op.name - Events use
op.kind="event"withop.domain+op.type - Args are always an object (query args or event attrs)
Success:
{
"id": "optional-correlation-id",
"ok": true,
"data": {},
"meta": {
"kind": "query",
"eci": "ECI_HERE",
"rid": "io.picolabs.manifold_pico",
"name": "getThings",
"httpStatus": 200
}
}Error:
{
"id": "optional-correlation-id",
"ok": false,
"error": {
"code": "HTTP_ERROR",
"message": "Upstream returned HTTP 500",
"details": {}
},
"meta": {
"kind": "query",
"eci": "ECI_HERE",
"rid": "io.picolabs.manifold_pico",
"name": "getThings",
"httpStatus": 500
}
}These helpers live in src/backend/krl-operation.js and all return the envelope above:
- Manifold pico
- Query:
manifold_getThings() - Event:
manifold_create_thing(thingName) - Event:
manifold_remove_thing(thingName) - Event:
manifold_change_thing_name(thingName, changedName)(note: KRL expectschangedName)
- Query:
- Thing pico (safeandmine + journal ruleset)
- Query:
scanTag(tagId, domain) - Query:
getNote(thingName, title) - Event:
updateOwnerInfo(thingName, ownerInfo: { name,email,phone,message, shareName,shareEmail,sharePhone }) - Event:
safeandmine_newtag(thingName, tagID, domain) - Event:
addNote(thingName, title, content)
- Query:
In MCP, a tool is described by:
- name: string identifier (e.g.
manifold_getThings) - description: short human/LLM guidance
- inputSchema: JSON Schema describing the tool’s
arguments
The MCP client sends: { name: "toolName", arguments: { ... } }
- Tool schemas:
src/mcp/tools.js - Server (stdio):
src/mcp/server.js(registers tools and returns the uniform envelope as JSON text)
Install dependencies (needs network):
npm installRun the MCP server:
npm run mcp:serverOnce this is running, an MCP client (like a desktop app / agent runner) can connect over stdio and call tools like manifold_getThings with { "eci": "..." }.
To get the mcp-client command interface working, make sure to install the AWS SDK dependency:
npm install @aws-sdk/client-bedrock-runtimeThen to get the interface up and running:
npm run client