Labsco
Inistate logo

Inistate

โ˜… 1

from Inistate

AI teammates with audit trails

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Inistate MCP Server

MCP server for the Inistate platform โ€” module discovery, entry management, and activity submission.

Tools

Tools marked (configure) are only exposed in configure mode โ€” see Modes. Tools the active backend cannot serve (e.g. scaffold_module on the hosted Platform) stay registered but return a structured capability message instead of failing silently.

ToolDescription
list_workspacesList workspaces the user has access to
set_workspaceSet the active workspace
list_modulesList all discoverable modules in the workspace
get_module_schemaGet the canvas schema (basic or extended tier) โ€” available in every mode
get_module_canvasGet full module definition with stable IDs (round-trippable) (configure)
list_entriesQuery entries with filters, sorting, and pagination
get_entryRead a single entry by ID
get_formGet form fields and defaults for an activity
submit_activityCreate, edit, delete, or run custom activities
submit_activitiesBulk variant โ€” same activity applied to up to 100 entries in one call
get_entry_historyGet entry audit trail and comments
request_upload_urlDefault upload path โ€” get a presigned S3 URL to PUT file bytes to
confirm_uploadConfirm a presigned upload completed; returns the File/Image field path
upload_fileFallback upload via base64/multipart (use only if the presigned flow fails)
download_fileDownload a file (returns pre-signed URL)
design_workflowGenerate a scaffolded module template from a description (configure)
validate_designValidate a module schema before creating or updating (configure)
create_moduleCreate a new module with schema (configure)
update_moduleUpdate an existing module's schema (configure)
scaffold_moduleDraft a module schema from existing data (SQLite, Notion, or Airtable table) (configure) โ€” served by the local runtime (inistate-core); on the hosted Platform backend it returns a capability message pointing to design_workflow
switch_modeSwitch the active mode (runtime / configure / frontend)

Resources

URIDescription
inistate://modulesList all modules
inistate://modules/{name}/canvasBasic module schema (fields + states)
inistate://modules/{name}/canvas/extendedExtended schema with activities and flows
inistate://guardrailsServer-enforced submit_activity rules (read once per session)
inistate://schema/runtimeRuntime schema โ€” entry/activity/file types and filter operators (default)
inistate://schema/configureModule-design schema โ€” write format, field types, colors (configure)
inistate://design-guideFACTS Module Design Guide (configure)
inistate://frontend-guideREST API reference for hand-written UIs (frontend)

Prompts

PromptDescription
design_factsops_workflowGuide an agent through designing a complete workflow module (configure)
execute_activityGuide an agent through executing a specific activity
diagnose_entryGuide an agent through investigating an entry's state and history
modify_moduleGuide 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).

ModeSurface
runtimeEntry and activity operations only โ€” querying, reading, submitting, files, history. The leanest surface for using existing modules.
configureEverything in runtime plus the module-design tools, resources, and prompts (marked (configure) above).
frontendEverything 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

  1. list_workspaces โ†’ set_workspace โ€” select a workspace (auto-selected when exactly one matches; both return the workspace's module list, so list_modules is only needed to refresh)
  2. get_module_schema โ€” understand a module's fields, states, and activities
  3. get_form โ€” discover required fields before the first submission per (module, activity); reuse its schema for further entries
  4. submit_activity โ€” create or update entries (submit_activities for bulk)
  5. list_entries โ€” query and browse data (use the fields parameter to keep payloads small)
  6. get_entry_history โ€” review entry history

Development

npm run watch          # Watch mode for TypeScript compilation
npm run inspector      # Test with MCP Inspector

MCP Setup

  1. Setup
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/

or

$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.gz
  1. Verify
mcp-publisher --help
  1. Authenticate
mcp-publisher login github
  1. Publish: see below

Packaging & Versioning

# Example adding new feature
git checkout -b feat/add-user-tool

# After coding
npx changeset

# Choose:
# 
# minor
# Added new user search tool

# Release
npm run release

# This does:
# install dependencies
# test
# bump version + update changelog + sync server.json
# validate MCP server config
# build (via npm prepare hook)
# publish to npm
# publish to MCP registry

PM2 (Ubuntu/AWS)

Run the HTTP transport in production using PM2:

npm install
npm run build
npm run pm2:start
npx pm2 save

Enable startup on reboot:

sudo npx pm2 startup systemd -u ubuntu --hp /home/ubuntu
npx pm2 save

Common operations:

npm run pm2:restart
npm run pm2:logs
npm run pm2:stop

Set 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 test

Watch mode (re-runs on file changes)

npm run test:watch

Test structure

Tests are in src/ alongside the source files and use Vitest:

FileTypeWhat it covers
src/schema.test.tsUnit tests (76)designWorkflow, validateDesign (including platform parity and input normalization), helper functions (isValidFieldType, isValidColor, isValidActor, suggestColorForState)
src/activity-guard.test.tsUnit tests (42)submit_activity guard rules โ€” human/hybrid actor, state-change confirmation, confidence-inflation, reference-shape validation
src/tools.schema.test.tsUnit tests (19)Tool input-schema shapes and validation
src/backend-capabilities.test.tsUnit tests (9)Capability gating โ€” tools the active backend cannot serve return a capability message
src/flagged-annotation.test.tsIntegration tests (5)Flagged-response annotation โ€” suppressed transitions are explained (flag_reason + agent_action) so agents stop retrying with higher confidence
src/server.test.tsIntegration 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_mode reveals and collapses it
  • design_workflow, validate_design work 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 inspector

Opens a browser UI where you can interactively call tools, inspect schemas, and see responses.