Model Context Protocol (MCP)
DecisionHub exposes a stateless Streamable HTTP MCP server at /mcp. An MCP-capable assistant can discover and execute HubItems, understand their input and output contracts, inspect or create Data Models, query permitted execution history, and search DecisionHub product documentation.
The MCP endpoint is part of the DecisionHub API. It does not run as a separate service.
What the server exposes
Dynamic HubItem tools
With the Execute grant, DecisionHub creates one MCP tool for every current executable HubItem in the API key's solution and environment:
- Decision Tables;
- Rulesets;
- Scorecards;
- Workflows;
- HTTP Clients;
- Coding HubItems.
Tool names begin with execute_ and use the HubItem identifier, for example:
execute_loan_eligibility
execute_customer_onboarding
The tool's input schema comes from the HubItem's linked input Data Model. Its output schema comes from the linked output Data Model when one is configured. This lets the MCP client construct typed requests and interpret results without copying contracts into the client configuration.
Tools are resolved when the client lists or invokes them. After deploying a new version, adding an item, or changing a model, ask the client to refresh its MCP tools.
Data Model capabilities
With DataModelRead, the server exposes:
list_data_models;get_data_model;decisionhub://data-models/{identifier}JSON Schema resources.
With DataModelCreate, it also exposes create_data_model. Creation is allowed only in Development, requires DataModelRead, consumes normal automation-asset capacity, and records the MCP key creator in HubItem history.
Model creation accepts a deliberately representable JSON Schema subset: objects, properties, required fields, supported scalar types and formats, homogeneous arrays, nullability, and local references. Composition, recursive or remote references, tuples, and constraints that DecisionHub cannot preserve are rejected rather than silently discarded.
Execution analytics
With Analytics, query_execution_history provides structured filtering, selection, grouping, ordering, and aggregates over non-debug execution history. Queries are restricted to HubItems in the key's exact solution and environment; the caller cannot supply another organization or an arbitrary OData URL.
Input/output payload fields are available only when the relevant analytics records exist. DecisionHub persists those payloads only when both organization analytics and the HubItem analytics setting are enabled. See Analytics and execution data.
Product documentation
Every authenticated MCP key can use:
search_documentationfor ranked product-document searches;decisionhub-docs://catalogfor the documentation catalog;decisionhub-docs://docs/{route}for individual Markdown documents.
Documentation is release-versioned and contains no tenant data. Tenant Data Model resources still require DataModelRead.
Security and API keys
Create a dedicated MCP key. Do not reuse an Execution API key or OData/BI key.
MCP keys:
- have a
dhmcp_prefix; - authenticate only to
/mcpwith a Bearer header; - are fixed to one organization, solution, and environment;
- can be expired, rotated, disabled, or revoked through the normal API-key lifecycle;
- are re-authorized on every protocol request so revocation takes effect immediately;
- expose only capabilities granted to the key.
The solution/environment boundary cannot be edited after creation. Create a new key when an assistant needs a different boundary.
| Grant | Capability | Creation requirement |
|---|---|---|
Execute | Discover and execute supported HubItems | API-key creation permission for the selected environment |
Analytics | Query scoped non-debug execution history | Organization analytics enabled; organization owner/admin creates the key |
DataModelRead | List/read models and schema resources | Data Model view permission |
DataModelCreate | Create version-1 models | Development plus Data Model view/create permission; automatically requires read |
Use the narrowest grant set and shortest practical expiry. Store the full secret in the MCP client's protected configuration, never in prompts, source control, or chat transcripts.
Create an MCP key
- Select the intended solution.
- Open Solution → API Keys.
- Select the environment.
- Choose Create new secret key.
- Set Key type to Model Context Protocol (MCP).
- Select only the required grants and an expiration.
- Create the key and copy the
dhmcp_...secret. It is shown once.
DecisionHub displays a ready-to-copy MCP connection block with the new secret.
Connect an MCP client
Use the API host, not the DecisionHub web-app host. For a local API running on port 5100:
{
"mcpServers": {
"decisionhub-local": {
"type": "streamable-http",
"url": "http://localhost:5100/mcp",
"headers": {
"Authorization": "Bearer dhmcp_REPLACE_WITH_SECRET"
}
}
}
}
For a deployed environment, replace the URL with the public API base URL followed by /mcp. MCP clients use different configuration filenames and may label Streamable HTTP as http; use the client's Streamable HTTP option while preserving the URL and Bearer header.
After connecting, ask the client to list DecisionHub tools. A healthy connection should show the static tools allowed by the grants plus execute_* tools for executable HubItems in scope.
Run the server locally
These commands assume the DecisionHubApi and DecisionHubReact repositories share the same parent directory. Install the .NET 8 SDK, Docker, Node.js/npm, and the EF Core CLI; if dotnet ef is unavailable, install the EF 8 tool with dotnet tool install --global dotnet-ef --version '8.*'.
1. Start local infrastructure
From DecisionHubApi:
docker compose -f infra/docker-compose.yml up -d
2. Apply database migrations
dotnet ef database update \
--project src/DecisionHubApi \
--startup-project src/DecisionHubApi
This must apply AddMcpApiKeys, which creates the MCP scope and key audit fields.
3. Export and serve documentation knowledge
From DecisionHubReact/docs-site:
npm install
npm run export:mcp
python3 -m http.server 3001 --directory build
The bundle is served at http://localhost:3001/mcp/docs-bundle-v1.json. This terminal remains occupied by the static file server. Documentation knowledge is optional for transport testing, but search_documentation will have no results without a configured bundle.
4. Start the DecisionHub API
In another terminal, from DecisionHubApi:
McpDocumentation__BundleUrl=http://localhost:3001/mcp/docs-bundle-v1.json \
dotnet run --project src/DecisionHubApi --launch-profile http
The MCP endpoint is now http://localhost:5100/mcp.
5. Start the DecisionHub UI
From DecisionHubReact:
npm install
npm run dev
Open http://localhost:3000, sign in, select a solution/environment, and create the MCP key as described above. Configure your MCP client with the local endpoint and one-time secret.
Example assistant requests
Once connected, prompts can be task-oriented:
List the DecisionHub tools available to you and explain the input contract for loan eligibility.
Execute loan eligibility for this payload and summarize the returned decision.
Show the Data Model for loan applications and identify required fields.
Group successful loan workflow executions by output/riskBand and count them.
Search the DecisionHub documentation for how analytics payload capture works.
The assistant can perform only the actions represented by the key's grants and current scoped resources.
Troubleshooting
| Symptom | Check |
|---|---|
401 Unauthorized | Header uses Authorization: Bearer dhmcp_...; key is active and unexpired |
Connects but no execute_* tools | Key has Execute; supported HubItems are active and present in the same solution/environment |
| Tool schema is open-ended | HubItem has no linked input or output Data Model in that environment |
| Data Model tools absent | Key includes DataModelRead or DataModelCreate as appropriate |
| Model creation rejected | Environment is Development, creator still exists, schema uses the supported subset, and capacity remains |
| Analytics tool absent | Key includes Analytics and its creator met analytics-administration requirements |
| Analytics rows are empty | Non-debug history exists in scope and analytics capture was enabled before those executions |
| Documentation search is empty | McpDocumentation__BundleUrl points to a reachable exported bundle |
| Recently deployed tool is stale | Refresh or reconnect the MCP client so it lists tools again |
Rotate or revoke the key immediately if its full secret is exposed.