inistate-mcp
v1.6.1
Published
MCP server for the Inistate platform — no-code apps creation powered by AI
Readme
Inistate MCP Server
MCP server for the Inistate platform — module discovery, entry management, and activity submission.
Setup
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| INISTATE_API_TOKEN | Yes | — | Bearer token for Inistate API authentication |
| INISTATE_API_BASE | No | https://api.inistate.com | API base URL |
| INISTATE_MCP_MODE | No | configure | Initial mode: runtime, configure, or frontend (see Modes) |
| INISTATE_MCP_NO_SETUP | No | — | Set to 1 to force server mode from a terminal (skip the interactive wizard) |
| INISTATE_DEBUG_FILE | No | — | Set to 1 to log write-path tool calls to ./debug.log, or to a path to log there. Off by default; logs identifiers only, never field values |
Install from npm (recommended)
No clone or build needed — npx will fetch and run the published package on demand:
npx -y inistate-mcpOr install globally:
npm install -g inistate-mcp
inistate-mcpInteractive setup (recommended)
Run the binary in a terminal with no MCP client attached and it walks you through entering your API token and picks the right config file for your client:
npx -y inistate-mcp
# or, explicitly:
npx -y inistate-mcp setupSupported clients: Claude Desktop, Claude Code (global or project-local .mcp.json), Cursor, Windsurf, Codex CLI, VS Code (user profile or workspace .vscode/mcp.json), Cline, Gemini CLI (global or workspace). Pick "Print config only" to get a JSON block to paste anywhere else.
The wizard only runs when stdin is a TTY (i.e., you launched it yourself). When an MCP client spawns the binary via piped stdio, it skips the wizard and runs as a normal MCP server — set INISTATE_MCP_NO_SETUP=1 if you need to force server mode from a terminal.
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"inistate": {
"command": "npx",
"args": ["-y", "inistate-mcp"],
"env": {
"INISTATE_API_TOKEN": "your-token-here"
}
}
}
}Claude Code Configuration
claude mcp add inistate -e INISTATE_API_TOKEN=your-token-here -- npx -y inistate-mcpInstall from source
git clone https://github.com/Inistate/inistate-mcp.git
cd inistate-mcp
npm install
npm run buildThen point your MCP client at node /absolute/path/to/inistate-mcp/build/index.js.
Tools
Tools marked (configure) are only exposed in configure mode — see Modes. Tools that depend on a local-runtime capability, such as scaffold_module, are not exposed by the hosted Platform.
| Tool | Description |
|------|-------------|
| list_workspaces | List workspaces the user has access to |
| set_workspace | Look up a workspace by id or name and return its module list (stores nothing) |
| list_modules | List all discoverable modules in the workspace |
| get_module_schema | Get the canvas schema (basic or extended tier) — available in every mode |
| get_module_canvas | Get full module definition with stable IDs (round-trippable) (configure) |
| list_entries | Query entries with filters, sorting, and pagination |
| aggregate_entries | Count, sum, average, min or max over matching entries, optionally grouped — the platform does the arithmetic |
| get_entry | Read a single entry by ID |
| get_form | Get form fields and defaults for an activity |
| submit_activity | Create, edit, delete, or run custom activities |
| submit_activities | Bulk variant — same activity applied to up to 100 entries in one call |
| get_entry_history | Get entry audit trail and comments |
| get_document | An entry's document, the system's own print or one designed in Inistate: a link that lasts up to an hour (default) or the file itself (max 4 MB) |
| request_upload_url | Default upload path — get a presigned S3 URL to PUT file bytes to |
| confirm_upload | Confirm a presigned upload completed; returns the File/Image field path |
| upload_file | Fallback upload via base64/multipart (use only if the presigned flow fails) |
| download_file | Download a file (returns pre-signed URL) |
| design_workflow | Generate a scaffolded module template from a description (configure) |
| validate_design | Validate a module schema before creating or updating (configure) |
| create_module | Create a new module with schema (configure) |
| update_module | Update an existing module's schema (configure) |
| scaffold_module | Draft a module schema from existing SQLite, Notion, or Airtable data (configure) — local runtime (inistate-core) only; it never creates a module |
| switch_mode | Switch the active mode (runtime / configure / frontend) |
Resources
| URI | Description |
|-----|-------------|
| inistate://modules | List all modules |
| inistate://modules/{name}/canvas | Basic module schema (fields + states) |
| inistate://modules/{name}/canvas/extended | Extended schema with activities and flows |
| inistate://guardrails | Server-enforced submit_activity rules (read once per session) |
| inistate://schema/runtime | Runtime schema — entry/activity/file types and filter operators (default) |
| inistate://schema/configure | Module-design schema — write format, field types, colors (configure) |
| inistate://design-guide | FACTS Module Design Guide (configure) |
| inistate://frontend-guide | REST API reference for hand-written UIs (frontend) |
Prompts
| Prompt | Description |
|--------|-------------|
| design_factsops_workflow | Guide an agent through designing a complete workflow module (configure) |
| execute_activity | Guide an agent through executing a specific activity |
| diagnose_entry | Guide an agent through investigating an entry's state and history |
| modify_module | Guide an agent through modifying an existing module's schema (configure) |
Modes
The server exposes a focused tool/resource surface depending on the active mode, keeping agent context lean. Use switch_mode to change it, or set the initial mode via the INISTATE_MCP_MODE env var (default: configure).
| Mode | Surface |
|------|---------|
| runtime | Entry and activity operations only — querying, reading, submitting, files, history. The leanest surface for using existing modules. |
| configure | Everything in runtime plus the module-design tools, resources, and prompts (marked (configure) above). |
| frontend | Everything in configure plus the inistate://frontend-guide resource for building hand-written UIs against the REST API. |
Tools and resources marked (configure) / (frontend) are absent from the tool list in narrower modes — switch modes to reveal them.
Typical Workflow
list_workspaces→set_workspace— find the workspace (when exactly one matches, list_workspaces returns its module list itself; both return it, solist_modulesis only needed to refresh). The server keeps no state between calls: passworkspaceIdon every later call, unlessINISTATE_WORKSPACE_IDis configured.get_module_schema— understand a module's fields, states, and activitiesget_form— discover required fields before the first submission per (module, activity); reuse its schema for further entriessubmit_activity— create or update entries (submit_activitiesfor bulk)list_entries— query and browse data (use thefieldsparameter to keep payloads small)get_entry_history— review entry history
Development
npm run watch # Watch mode for TypeScript compilation
npm run inspector # Test with MCP InspectorBranches
mainis the development branch. Feature and fix work lands here.productionis the publishing branch. It only receives release merges.
Packaging & Versioning
Every change that should ship needs a changeset:
# After coding, on a feature branch merged into main
npx changeset
# Choose the bump (patch / minor / major) and describe the changeReleasing
Releases run from main. A release is a v* tag on production; pushing the tag
runs the Publish GitHub Actions workflow (.github/workflows/publish.yml), which
publishes to npm and the MCP registry.
npm run release # full release
npm run release -- --no-push # do everything locally, push nothing
npm run package:chatgpt # create the ChatGPT plugin ZIP in artifacts/This does:
- Checks you are on an up-to-date
mainwith a pending changeset - Runs tests and the build
- Bumps the version, updates the changelog and syncs
server.json - Commits
Release vX.Y.Zonmain, mergesmainintoproductionand tagsvX.Y.Z - Pushes
main,productionand the tag
The workflow fails if the tag, package.json and server.json versions disagree, or if
the tagged commit is not on production. It skips the npm publish when that version is
already on npm.
Setup the workflow relies on (one time):
- npm: add a Trusted Publisher for this package (GitHub Actions, repo
Inistate/inistate-mcp, workflowpublish.yml) - MCP registry: the workflow logs in with GitHub OIDC, so no personal login is needed
Publishing manually (fallback)
Only if the workflow is unavailable. Install mcp-publisher:
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher && sudo mv mcp-publisher /usr/local/bin/$arch = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { "arm64" } else { "amd64" }; Invoke-WebRequest -Uri "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_windows_$arch.tar.gz" -OutFile "mcp-publisher.tar.gz"; tar xf mcp-publisher.tar.gz mcp-publisher.exe; rm mcp-publisher.tar.gzThen, from the released commit:
npm publish
mcp-publisher validate
mcp-publisher login github # needs a public Inistate org membership
mcp-publisher publishDeployment
Deployment is done by hand; there is no CI deploy. After a release, update the server (see PM2 below):
npm run update # git pull, npm ci only if the lockfile changed, then deploy
npm run rollback # if it went wrong after the fact: restores build-prevDo not run npm run build on the server while it is serving: it starts with rimraf build, and
pm2 runs the live server from build/, so the server is left on an empty or half-written folder
and stalls. (Installing no longer builds: there is no prepare script, only prepublishOnly.) npm run deploy (run by npm run update) compiles
into build-next and only renames folders once that succeeded; if the new build does not answer
/health it puts the previous one back.
npm ci also deletes node_modules while the server is running, so run it only when
dependencies changed, and follow it at once with npm run deploy.
The PM2 app runs in cluster mode with one instance, so pm2 reload starts the new process,
waits for it to report ready, then stops the old one (in-flight requests get 8 s to finish).
Keep instances: 1: the OAuth provider keeps pending logins and tokens in process memory, and a
login that reached two different workers would fail. After the first deploy of this change run
pm2 delete inistate-mcp && npm run pm2:start && npx pm2 save once, because an existing fork-mode
app does not switch to cluster mode on reload.
PM2 (Ubuntu/AWS)
Run the HTTP transport in production using PM2:
npm install
npm run build
npm run pm2:start
npx pm2 saveEnable startup on reboot:
sudo npx pm2 startup systemd -u ubuntu --hp /home/ubuntu
npx pm2 saveCommon operations:
npm run pm2:restart
npm run pm2:logs
npm run pm2:stopSet required environment variables (INISTATE_API_TOKEN, and optionally INISTATE_API_BASE, INISTATE_WORKSPACE_ID, OAUTH_ISSUER_URL, INISTATE_APP_URL) in your shell, PM2 ecosystem env, or deployment secret manager before starting.
Testing
Run all tests
npm testWatch mode (re-runs on file changes)
npm run test:watchTest structure
Tests are in src/ alongside the source files and use Vitest:
| File | Type | What it covers |
|------|------|----------------|
| src/schema.test.ts | Unit tests (76) | designWorkflow, validateDesign (including platform parity and input normalization), helper functions (isValidFieldType, isValidColor, isValidActor, suggestColorForState) |
| src/activity-guard.test.ts | Unit tests (42) | submit_activity guard rules — human/hybrid actor, state-change confirmation, confidence-inflation, reference-shape validation |
| src/tools.schema.test.ts | Unit tests (19) | Tool input-schema shapes and validation |
| src/backend-capabilities.test.ts | Unit tests (9) | Capability gating — tools the active backend cannot serve return a capability message |
| src/flagged-annotation.test.ts | Integration tests (5) | Flagged-response annotation — suppressed transitions are explained (flag_reason + agent_action) so agents stop retrying with higher confidence |
| src/server.test.ts | Integration tests (17) | Spins up the MCP server as a child process and exercises it through the official MCP SDK client — mode-gated tool/resource/prompt discovery, switch_mode, resource reads, prompt retrieval, and local tool calls |
Unit tests cover:
- Field type and color validation against the schema
- State color suggestion logic
- Design validation: duplicate names, invalid types/colors/actors, initial state rules, flow integrity, unreachable states, unused activities, AI confidence warnings
- Input normalization: field-type, state-color, and industry aliases; parsing states from a description
- Workflow design: pattern detection (approval, ticket, pipeline, record list), industry defaults
Integration tests verify (no API token needed):
- Mode-gated tool/resource/prompt discovery — runtime mode hides the configure surface,
switch_modereveals and collapses it design_workflow,validate_designwork end-to-end through the MCP protocol- Static resources (
inistate://schema/runtime,inistate://design-guide) return valid content - All 4 prompts return correctly templated messages
Interactive testing with MCP Inspector
INISTATE_API_TOKEN=your-token npm run inspectorOpens a browser UI where you can interactively call tools, inspect schemas, and see responses.
