MCP Server
Portway hosts an MCP server over HTTP. Endpoints with Mcp.Exposed: true are registered as tools for MCP clients (e.g. Claude Desktop, VS Code Copilot, custom agents) and the built-in Chat UI. Every tool call runs under the caller's token, scopes and environments.
Enable the MCP server
Setting Mcp:Enabled: true in appsettings.json enables the server at Mcp:Path (default /mcp).
"Mcp": {
"Enabled": true,
"Path": "/mcp",
"RequireAuthentication": true,
"ChatEnabled": true
}| Field | Required | Type | Description |
|---|---|---|---|
Enabled |
Yes | bool | Enables the MCP server (default false) |
Path |
No | string | Server path (default /mcp) |
RequireAuthentication |
No | bool | Requires a Portway Bearer token (default true) |
ChatEnabled |
No | bool | Enables the Chat UI and /ui/api/mcp/chat; provider credentials are set in the setup wizard (default false) |
WARNING
Keep RequireAuthentication: true on any network-reachable deployment; false exposes all registered tools without credentials.
Expose an endpoint as an MCP tool
Setting Mcp.Exposed: true in entity.json registers one tool per HTTP method of the endpoint.
{
"DatabaseObjectName": "OutstandingItems",
"DatabaseSchema": "dbo",
"AllowedEnvironments": ["500","700"],
"AllowedMethods": ["GET"],
"Mcp": {
"Exposed": true,
"Instruction": "Always include a $filter on AccountCode. Results are paginated; use $top and $skip."
}
}| Field | Required | Type | Description |
|---|---|---|---|
Exposed |
Yes | bool | Registers the endpoint as MCP tools (default false) |
Instruction |
No | string | Text appended to the tool description for the model, e.g. required filters or data shape |
Tool names follow {namespace}_{name}_{method}, or {name}_{method} without a namespace (e.g. products_GET). Instruction changes only the model-facing description, not the Explorer summary.
Tools for endpoints with tenant headers list them in GetEndpointInfo (TenantHeaders) and accept their values in the tenants argument of CallEndpoint, e.g. {"X-Company-Id": "ACME"}.
Namespaces
The Explorer and ListEndpoints group tools by Namespace; tools without one are listed under default.
{
"Namespace": "inventory",
"Mcp": {
"Exposed": true
}
}Configuration: Namespaces.
Built-in server tools
| Tool | Description |
|---|---|
ListEndpoints |
Returns all registered tools grouped by namespace |
GetEndpointInfo |
Returns URL, methods, environments and tenant headers of an endpoint |
CallEndpoint |
Calls an endpoint with an environment, OData query, JSON body and tenant values |
Connect an MCP client
http(s)://{host}{Mcp:Path}With RequireAuthentication: true, requests include a Portway Bearer token:
Authorization: Bearer {token}Scope agent tokens to the required endpoints and environments: Access Tokens.
Web UI
Console views under MCP:
- Explorer (
/ui/mcp/explorer): registered tools by namespace, with methods and endpoint links; requires onlyMcp:Enabled: true - Chat (
/ui/mcp/chat): an AI model calling Portway tools; requires Chat configuration
Next steps
- MCP Chat
- Access Tokens
- Namespaces
- Entity configuration: full
entity.jsonreference includingExposed
Portway