Skip to content

Commit 8958d7f

Browse files
author
Dev Agent Amelia
committed
feat(v0.4.0): attribute types (Lookup/MultiSelect/AutoNumber/Image) + schema consistency + HTTP transport polish + audit corrections (P0-P3)
Sprints 2/3/4: - New attribute types: Lookup (via RelationshipDefinitions), MultiSelectPicklist, AutoNumber, Image - Fixed MultiSelect OptionSetType (MultiSelect, not Picklist) - createRelationship reads OData-EntityId response header (204 No Content) - buildLookupRelationshipBody: correct SchemaName formula, 100-char guard, CascadeConfiguration, AssociatedMenuConfiguration - lbl() now emits @odata.type on each LocalizedLabel - HTTP server: HMAC-SHA256 timing-safe token verify, WWW-Authenticate header, configurable CORS origin, GET/DELETE session guard - Schema: confirm const:true on destructive tools, EntitySetName cache in detect_duplicates, hasSysAdmin preflight handler - Split attribute.tools.ts => attribute.definitions.ts + attribute.tools.ts (both <400 lines) - config.example.json -> config.example.jsonc; docs updated with BEARER_TOKEN + MCP_HTTP_CORS_ORIGIN
1 parent 52aea6c commit 8958d7f

12 files changed

Lines changed: 112 additions & 25 deletions

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
**The most complete MCP server for Microsoft Dataverse.**
88

9-
Give your AI agents real-time access to Dataverse — query records with OData & FetchXML, manage metadata, inspect solutions, run batch operations, audit changes, and more. Zero-config auth via Microsoft device code flow.
10-
119
63 tools · 4 resources · 10 guided workflows · Zero config auth
1210

1311
[![npm](https://img.shields.io/npm/v/mcp-dataverse)](https://www.npmjs.com/package/mcp-dataverse)
@@ -80,6 +78,31 @@ Re-authenticate after ~90 days of inactivity: `npx mcp-dataverse-auth`
8078

8179
---
8280

81+
## HTTP Transport
82+
83+
Run as an HTTP server for multi-client use:
84+
85+
```bash
86+
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 MCP_HTTP_SECRET=mysecret node dist/server.js
87+
```
88+
89+
Connect using VS Code / Copilot with:
90+
```json
91+
{
92+
"servers": {
93+
"dataverse": {
94+
"type": "http",
95+
"url": "http://localhost:3000/mcp",
96+
"headers": {
97+
"Authorization": "Bearer mysecret"
98+
}
99+
}
100+
}
101+
}
102+
```
103+
104+
---
105+
83106
## Troubleshooting
84107

85108
| Symptom | Fix |

config.example.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

config.example.jsonc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"environmentUrl": "https://yourorg.crm.dynamics.com",
3+
"requestTimeoutMs": 30000,
4+
"maxRetries": 3
5+
}
6+
7+
// HTTP transport mode (optional — uncomment to use)
8+
// {
9+
// "environmentUrl": "https://yourorg.crm.dynamics.com",
10+
// "requestTimeoutMs": 30000,
11+
// "maxRetries": 3,
12+
// "transport": "http",
13+
// "httpPort": 3000
14+
// }
15+
//
16+
// Matching environment variables:
17+
// MCP_TRANSPORT=http
18+
// MCP_HTTP_PORT=3000
19+
// MCP_HTTP_SECRET=your-bearer-token (optional: enables Authorization header check)
20+
// MCP_HTTP_JSON_RESPONSE=true (default: true; set to false for SSE streaming)
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dataverse-client-advanced-2227NJRQ.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import{b as a}from"./chunk-75JPRQKI.js";export{a as DataverseAdvancedClient};

dist/doctor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/http-server.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/server.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/getting-started.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,54 @@ npx mcp-dataverse --transport http --port 3001
125125

126126
The MCP endpoint is available at `http://localhost:3001/mcp`.
127127

128+
## HTTP Transport
129+
130+
The server can run in HTTP mode instead of stdio, which enables multi-client connections and browser-based access.
131+
132+
### Starting the HTTP server
133+
134+
Set the `MCP_TRANSPORT` environment variable to `http`:
135+
136+
```bash
137+
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/server.js
138+
```
139+
140+
Or in `config.json`:
141+
```json
142+
{
143+
"transport": "http",
144+
"httpPort": 3000
145+
}
146+
```
147+
148+
### Environment variables
149+
150+
| Variable | Default | Description |
151+
|----------|---------|-------------|
152+
| `MCP_HTTP_PORT` | `3000` | Port to listen on |
153+
| `MCP_HTTP_JSON_RESPONSE` | `true` | Enable JSON response mode (vs SSE streaming) |
154+
| `MCP_HTTP_SECRET` | *(none)* | Bearer token for authentication. If set, all `/mcp` requests must include `Authorization: Bearer <token>` |
155+
| `BEARER_TOKEN` | *(none)* | Deprecated alias for `MCP_HTTP_SECRET`. Use `MCP_HTTP_SECRET` in new setups. |
156+
| `MCP_HTTP_CORS_ORIGIN` | `*` | Allowed CORS origin. Set to your app origin (e.g. `http://localhost:5173`) when auth is enabled to restrict browser access. |
157+
158+
### Authentication
159+
160+
When `MCP_HTTP_SECRET` is set, every request to `/mcp` must include:
161+
```
162+
Authorization: Bearer your-secret-token
163+
```
164+
165+
### Health check
166+
167+
```
168+
GET /health
169+
```
170+
Returns `{"status":"ok","version":"...","tools":<count>}`. No authentication required.
171+
172+
### Multi-client support
173+
174+
Each client gets a dedicated MCP session identified by `mcp-session-id`. Sessions are automatically cleaned up on disconnect.
175+
128176
## Diagnostics
129177

130178
Run the built-in health check to verify your configuration and connectivity:

0 commit comments

Comments
 (0)