@databasin/mcp-client 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -61
- package/dist/auth-schema.d.ts +23 -0
- package/dist/auth-schema.d.ts.map +1 -0
- package/dist/auth-schema.js +42 -0
- package/dist/auth-schema.js.map +1 -0
- package/dist/auth-tools.d.ts +10 -0
- package/dist/auth-tools.d.ts.map +1 -0
- package/dist/auth-tools.js +60 -0
- package/dist/auth-tools.js.map +1 -0
- package/dist/auth.d.ts +22 -11
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +71 -71
- package/dist/auth.js.map +1 -1
- package/dist/browser.d.ts +20 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +19 -17
- package/dist/browser.js.map +1 -1
- package/dist/cli.d.ts +31 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +148 -67
- package/dist/cli.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/correlation.d.ts +6 -0
- package/dist/correlation.d.ts.map +1 -0
- package/dist/correlation.js +15 -0
- package/dist/correlation.js.map +1 -0
- package/dist/credential-store.d.ts +21 -0
- package/dist/credential-store.d.ts.map +1 -0
- package/dist/credential-store.js +46 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/errors.d.ts +17 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +24 -6
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/login-url.d.ts +18 -0
- package/dist/login-url.d.ts.map +1 -0
- package/dist/login-url.js +82 -0
- package/dist/login-url.js.map +1 -0
- package/dist/mcp-endpoint.d.ts +5 -0
- package/dist/mcp-endpoint.d.ts.map +1 -0
- package/dist/mcp-endpoint.js +22 -0
- package/dist/mcp-endpoint.js.map +1 -0
- package/dist/proxy-tools.d.ts +5 -0
- package/dist/proxy-tools.d.ts.map +1 -0
- package/dist/proxy-tools.js +39 -0
- package/dist/proxy-tools.js.map +1 -0
- package/dist/remote-mcp.d.ts +27 -0
- package/dist/remote-mcp.d.ts.map +1 -0
- package/dist/remote-mcp.js +70 -0
- package/dist/remote-mcp.js.map +1 -0
- package/dist/safety.d.ts +4 -0
- package/dist/safety.d.ts.map +1 -1
- package/dist/safety.js +94 -10
- package/dist/safety.js.map +1 -1
- package/dist/server.d.ts +4 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +32 -15
- package/dist/server.js.map +1 -1
- package/dist/token-validation.d.ts +5 -0
- package/dist/token-validation.d.ts.map +1 -0
- package/dist/token-validation.js +183 -0
- package/dist/token-validation.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -7
- package/dist/api-client.d.ts +0 -43
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-client.js +0 -154
- package/dist/api-client.js.map +0 -1
- package/dist/mappers.d.ts +0 -56
- package/dist/mappers.d.ts.map +0 -1
- package/dist/mappers.js +0 -171
- package/dist/mappers.js.map +0 -1
- package/dist/schemas.d.ts +0 -154
- package/dist/schemas.d.ts.map +0 -1
- package/dist/schemas.js +0 -102
- package/dist/schemas.js.map +0 -1
- package/dist/tools.d.ts +0 -17
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -117
- package/dist/tools.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,108 +1,179 @@
|
|
|
1
1
|
# DataBasin MCP Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Local stdio MCP proxy for DataBasin. It keeps Microsoft Entra credentials in the OS-protected MSAL cache and connects to DataBasin's true Streamable HTTP MCP endpoint with the official MCP SDK.
|
|
4
4
|
|
|
5
|
-
Production is the default.
|
|
5
|
+
Production is the default. The non-production profile is selected with `--environment np`.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Version 0.2.0 production release
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- A DataBasin account
|
|
11
|
-
- A supported OS credential store: Windows DPAPI, macOS Keychain, or Linux Secret Service/LibSecret
|
|
9
|
+
Version `0.2.0` replaces the legacy REST adapter with a true MCP proxy for the deployed production server, including support tickets and notifications. Upgrade clients pinned to `0.1.0` or `0.2.0-beta.1`; those versions do not implement this transport. Production is the default:
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npx -y @databasin/mcp-client@0.2.0 doctor
|
|
13
|
+
npx -y @databasin/mcp-client@0.2.0 login
|
|
14
|
+
```
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
The client requires Node.js 22.20+ or Node.js 24 and an available OS-protected credential store. `doctor` reports the selected fixed profile, runtime support, credential-store availability, and sign-in state; it never prints account identity, tokens, or credentials.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
2. Call `databasin_login` when sign-in is needed. It returns Microsoft's short-lived device-login URL and user code immediately.
|
|
19
|
-
3. Give you that URL and code. You can complete sign-in from any browser or device, after which the assistant calls `databasin_auth_status` again.
|
|
18
|
+
For non-production, use the same stable package with the NP profile:
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
| Host | NP setup |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| Codex | `codex mcp add databasin-np -- npx -y @databasin/mcp-client@0.2.0 --environment np` |
|
|
23
|
+
| Claude Code | `claude mcp add --transport stdio --scope user databasin-np -- npx -y @databasin/mcp-client@0.2.0 --environment np` |
|
|
24
|
+
| Claude Desktop / Cursor-compatible config | Use the `mcpServers` JSON below |
|
|
25
|
+
| VS Code | Use the `servers` JSON below in user or workspace `mcp.json` |
|
|
26
|
+
| OpenCode v2 | Use the `mcp.servers` JSON below in `opencode.jsonc` |
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
Claude Desktop and other hosts that accept the common `mcpServers` shape:
|
|
24
29
|
|
|
25
|
-
```
|
|
26
|
-
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"databasin-np": {
|
|
34
|
+
"type": "stdio",
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@databasin/mcp-client@0.2.0", "--environment", "np"]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
27
40
|
```
|
|
28
41
|
|
|
29
|
-
|
|
42
|
+
VS Code `mcp.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"servers": {
|
|
47
|
+
"databasinNp": {
|
|
48
|
+
"type": "stdio",
|
|
49
|
+
"command": "npx",
|
|
50
|
+
"args": ["-y", "@databasin/mcp-client@0.2.0", "--environment", "np"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
30
55
|
|
|
31
|
-
|
|
56
|
+
OpenCode v2 `opencode.jsonc`:
|
|
32
57
|
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
```jsonc
|
|
59
|
+
{
|
|
60
|
+
"$schema": "https://opencode.ai/config.json",
|
|
61
|
+
"mcp": {
|
|
62
|
+
"servers": {
|
|
63
|
+
"databasin-np": {
|
|
64
|
+
"type": "local",
|
|
65
|
+
"command": ["npx", "-y", "@databasin/mcp-client@0.2.0", "--environment", "np"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
36
70
|
```
|
|
37
71
|
|
|
38
|
-
|
|
72
|
+
On native Windows, a host that cannot launch `npx` directly should use `cmd` with arguments beginning `[/c, npx, ...]` (JSON string form: `["/c", "npx", ...]`). Restart the host after changing its MCP configuration so it refreshes the server-owned tool inventory.
|
|
73
|
+
|
|
74
|
+
The only remote MCP endpoints are:
|
|
75
|
+
|
|
76
|
+
- Production: `https://databasin.cloud/mcp`
|
|
77
|
+
- NP: `https://databasin-ui-np.grayriver-813df174.centralus.azurecontainerapps.io/mcp`
|
|
78
|
+
|
|
79
|
+
The downstream connection pins MCP `2026-07-28` and has no REST or legacy-protocol fallback. Tool discovery and listing are public protocol operations. The client obtains a local access token only for `tools/call`, adds it as a bearer credential to that request, and rejects HTTP redirects so credentials cannot cross origins.
|
|
80
|
+
|
|
81
|
+
## Install and connect
|
|
39
82
|
|
|
40
83
|
```bash
|
|
41
|
-
|
|
84
|
+
npx -y @databasin/mcp-client
|
|
42
85
|
```
|
|
43
86
|
|
|
44
|
-
|
|
87
|
+
The client requires an OS credential store. On Linux, an available and unlocked
|
|
88
|
+
Secret Service/libsecret keyring is required; headless environments must provide
|
|
89
|
+
one explicitly. The client fails closed rather than falling back to a plaintext
|
|
90
|
+
token cache.
|
|
91
|
+
|
|
92
|
+
Codex:
|
|
45
93
|
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
command = "npx"
|
|
49
|
-
args = ["-y", "@databasin/mcp-client"]
|
|
94
|
+
```bash
|
|
95
|
+
codex mcp add databasin -- npx -y @databasin/mcp-client
|
|
50
96
|
```
|
|
51
97
|
|
|
52
|
-
|
|
98
|
+
Claude Code:
|
|
53
99
|
|
|
54
100
|
```bash
|
|
55
101
|
claude mcp add --transport stdio --scope user databasin -- npx -y @databasin/mcp-client
|
|
56
102
|
```
|
|
57
103
|
|
|
58
|
-
|
|
104
|
+
To use non-production:
|
|
59
105
|
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
"mcpServers": {
|
|
63
|
-
"databasin": {
|
|
64
|
-
"command": "npx",
|
|
65
|
-
"args": ["-y", "@databasin/mcp-client"]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
106
|
+
```bash
|
|
107
|
+
npx -y @databasin/mcp-client --environment np
|
|
69
108
|
```
|
|
70
109
|
|
|
71
|
-
|
|
110
|
+
The assistant can call `databasin_login` and give you the short-lived Microsoft device URL and code. Enter credentials only on Microsoft’s page. The client never sends credentials or tokens through MCP tool output.
|
|
72
111
|
|
|
73
|
-
|
|
112
|
+
Device login output is restricted to the HTTPS `microsoft.com/devicelogin` endpoint (with an optional trailing slash, canonicalized away). Interactive CLI login is restricted to the configured tenant’s exact `login.microsoftonline.com/<tenant>/oauth2/v2.0/authorize` path and client ID. Credential-bearing URLs, redirects to other hosts, other schemes, ports, fragments, and unexpected paths fail closed before a URL is opened or returned. Raw MSAL device codes, polling intervals/handles, and provider messages are discarded immediately; only the validated verification URL, human-entered user code, and expiry are retained.
|
|
74
113
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
args = ["-y", "@databasin/mcp-client", "--environment", "np"]
|
|
79
|
-
```
|
|
114
|
+
Before using an MSAL access token, the client fail-closes on its tenant, issuer, audience, delegated scope, timing, authority, account, and expiry metadata. JWT payload decoding here is local defense-in-depth, not signature verification; the DataBasin API remains the cryptographic validation and authorization boundary.
|
|
115
|
+
|
|
116
|
+
## Tools
|
|
80
117
|
|
|
81
|
-
|
|
118
|
+
The production server currently exposes twenty product tools, plus this client's two local authentication helpers (twenty-two total). Product tools are discovered dynamically from the remote DataBasin MCP server and mirrored over local stdio. Their names, descriptions, annotations, input/output schemas, and timeout metadata are server-owned; this package does not keep a second product-tool contract. The current server catalog is:
|
|
82
119
|
|
|
83
|
-
|
|
120
|
+
- `databasin_get_capabilities` — fetch the server-owned capability allowlist.
|
|
121
|
+
- `databasin_get_context` — fetch authorized project and connector metadata.
|
|
122
|
+
- `databasin_search` — bounded authorized metadata search.
|
|
123
|
+
- `databasin_get_schema` — bounded non-secret schema metadata.
|
|
124
|
+
- `databasin_run_agent` — run the fixed `metadata_readonly` profile for an explicit institution and optional project/connector scope.
|
|
125
|
+
- `databasin_get_agent_run` — read an authorized run status/result.
|
|
126
|
+
- `databasin_cancel_agent_run` — request cancellation and report the server’s truthful state.
|
|
127
|
+
- `databasin_run_query` — execute a single read-only `SELECT`/`WITH` statement against an authorized connector and return up to `maxRows` rows.
|
|
128
|
+
- `databasin_get_query_status` — read an authorized query's status, and its columns/rows/error once terminal.
|
|
129
|
+
- `databasin_cancel_query` — request cancellation and report the server’s truthful state.
|
|
130
|
+
- `databasin_run_assistant` — run the read-only DataBasin assistant (a server-side Claude Code agent) that browses metadata and runs DataBasin skills over multiple steps to answer a natural-language request.
|
|
84
131
|
|
|
85
|
-
|
|
132
|
+
Support tools are also discovered: `databasin_get_support_context`, `databasin_list_support_tickets`, `databasin_get_support_ticket`, `databasin_create_support_ticket`, `databasin_add_support_ticket_message`, `databasin_update_support_ticket`, `databasin_list_support_notifications`, `databasin_mark_support_notification_read`, and `databasin_mark_all_support_notifications_read`. Support operations include writes; follow their server-owned schemas and annotations. Ticket/message data includes authorized email fields, and optional values may be null.
|
|
133
|
+
|
|
134
|
+
The other two tools, `databasin_auth_status` and `databasin_login`, are client-local authentication helpers. They interact only with the local MSAL credential manager and Microsoft sign-in; they are not part of the remote product catalog.
|
|
135
|
+
|
|
136
|
+
No organization configuration is required. Unscoped `databasin_get_context` and `databasin_search` discover metadata only across organizations the signed-in user is authorized to access. A project-scoped search must include its `institutionId`; account discovery is not a wildcard and never broadens server-side authorization.
|
|
86
137
|
|
|
87
|
-
- `
|
|
88
|
-
- `databasin_login`: return Microsoft device-login instructions without blocking the assistant
|
|
89
|
-
- `databasin_get_context`: list caller-visible projects and connection identifiers
|
|
90
|
-
- `databasin_search`: search visible pipelines, connectors, and automations
|
|
91
|
-
- `databasin_browse_schema`: browse catalogs, schemas, tables, and columns
|
|
92
|
-
- `databasin_get_operation`: read bounded query status and results
|
|
93
|
-
- `databasin_cancel_operation`: request cancellation of a visible query operation
|
|
138
|
+
The client does not expose arbitrary SQL, shell commands, connector credentials, arbitrary URLs, or arbitrary headers. The remote server validates product inputs, authorization, output safety, query policy, and response bounds. `databasin_run_query` accepts only a single read-only `SELECT`/`WITH` statement under that server-owned contract. Every product success is the MCP result returned by the server, including its structured `{ "data": T, "correlationId": "..." }` payload.
|
|
94
139
|
|
|
95
|
-
|
|
140
|
+
`databasin_run_agent` accepts the scope and execution fields advertised in its discovered schema and always uses the server-owned `metadata_readonly` profile. The remote MCP tool owns run creation, bounded polling, cancellation on MCP abort, authorization rechecks, and any idempotency behavior; the local proxy performs one `tools/call` and forwards its cancellation signal.
|
|
96
141
|
|
|
97
|
-
|
|
142
|
+
Agent status, result, and cancellation responses include the complete server-authorized scope. A canonical run contains `runId`, the three scope IDs (nullable where optional), `profile`, `status`, bounded `result`/`error`, and `createdAt`/`updatedAt`. Cancellation reports the state returned by the server and does not imply completion before the server says `cancelled`.
|
|
98
143
|
|
|
99
|
-
The
|
|
144
|
+
`databasin_run_query` accepts the bounded connector, SQL, and row-limit fields in the discovered schema. The remote MCP tool owns its bounded polling and timeout behavior. Status and cancellation remain explicit tools for follow-up. A canonical query result contains `queryId`, `connectorId`, `status`, bounded `columns`/`data`/`rowCount`, `truncated`, and `error`.
|
|
145
|
+
|
|
146
|
+
`databasin_run_assistant` remains the server's bounded, read-only assistant operation. It is metadata-and-skills only; use `databasin_run_query` for SQL. The server advertises the accepted input and output schemas plus the call timeout in MCP metadata, and the client mirrors them without local copies. This transport change does not replace or modify the server's existing Claude Agent SDK runtime.
|
|
147
|
+
|
|
148
|
+
## CLI fallback
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx -y @databasin/mcp-client login
|
|
152
|
+
npx -y @databasin/mcp-client status
|
|
153
|
+
npx -y @databasin/mcp-client logout
|
|
154
|
+
npx -y @databasin/mcp-client login --environment np
|
|
155
|
+
npx -y @databasin/mcp-client doctor --environment np
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Environment aliases `production` and `staging`/`test` are accepted for `prod` and `np` respectively.
|
|
159
|
+
|
|
160
|
+
## Development
|
|
100
161
|
|
|
101
162
|
```bash
|
|
102
163
|
npm ci
|
|
103
164
|
npm run verify
|
|
104
|
-
npm
|
|
105
|
-
npm
|
|
165
|
+
npm audit --omit=dev --audit-level=high
|
|
166
|
+
npm run verify:package
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`npm run verify` runs the TypeScript check, unit tests, build, and stdio child-process E2E. CI runs those checks on Node 22 and 24 across Linux, macOS, and Windows, audits production dependencies, and verifies the exact package allowlist with `npm pack --dry-run --json`.
|
|
170
|
+
|
|
171
|
+
Release qualification uses an exact local tarball, never a mutable dist-tag. After `npm pack`, an authorized tester with an existing production session can run the read-only qualification:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
DATABASIN_MCP_TARBALL=./databasin-mcp-client-0.2.0.tgz npm run qualify:package
|
|
106
175
|
```
|
|
107
176
|
|
|
108
|
-
|
|
177
|
+
Set `DATABASIN_MCP_QUALIFY_ENVIRONMENT=np` to qualify against NP instead. This check installs the exact artifact in a temporary directory, starts its stdio executable, checks local sign-in and the twenty-two-tool inventory, and calls only context/search/support read operations. It never creates agent jobs, executes SQL, or changes support data, and does not print credentials or business content. The old `qualify:np` script remains only for historical beta lifecycle qualification.
|
|
178
|
+
|
|
179
|
+
Release approval still requires proof of the Entra registration, tenant, issuer, audience, delegated scope, and wrong-claim rejection behavior for each environment.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AssistantAuthOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
status: z.ZodLiteral<"pending">;
|
|
4
|
+
environment: z.ZodEnum<{
|
|
5
|
+
prod: "prod";
|
|
6
|
+
np: "np";
|
|
7
|
+
}>;
|
|
8
|
+
loginUrl: z.ZodNullable<z.ZodString>;
|
|
9
|
+
userCode: z.ZodOptional<z.ZodString>;
|
|
10
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
11
|
+
message: z.ZodString;
|
|
12
|
+
}, z.core.$strict>, ...z.ZodObject<{
|
|
13
|
+
status: z.ZodLiteral<"authenticated" | "not_authenticated" | "failed">;
|
|
14
|
+
environment: z.ZodEnum<{
|
|
15
|
+
prod: "prod";
|
|
16
|
+
np: "np";
|
|
17
|
+
}>;
|
|
18
|
+
loginUrl: z.ZodNull;
|
|
19
|
+
userCode: z.ZodOptional<z.ZodNever>;
|
|
20
|
+
expiresAt: z.ZodOptional<z.ZodNever>;
|
|
21
|
+
message: z.ZodString;
|
|
22
|
+
}, z.core.$strict>[]], "status">;
|
|
23
|
+
//# sourceMappingURL=auth-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-schema.d.ts","sourceRoot":"","sources":["../src/auth-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;gCAuBpC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateDeviceLoginUrl } from './login-url.js';
|
|
3
|
+
const authEnvironment = z.enum(['prod', 'np']);
|
|
4
|
+
const URL_LIKE_AUTH_MESSAGE = /(?:\b(?:https?|hxxps?|ftp|file|data|javascript)\s*:\s*(?:[/\\]\s*){0,2}|\bwww\s*(?:\.|\[\.\]|\(\.\))|(?:\b|@)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.|\[\.\]|\(\.\)))+[a-z]{2,63}(?=\b|[/:?#])|\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3})(?=[:/\s]|$))/iu;
|
|
5
|
+
const authMessage = z.string().max(1_000).refine((value) => !URL_LIKE_AUTH_MESSAGE.test(normalizeAuthMessage(value)), 'The authentication message was rejected.');
|
|
6
|
+
const safeDeviceLoginUrl = z.string().max(4_096).superRefine((value, context) => {
|
|
7
|
+
try {
|
|
8
|
+
validateDeviceLoginUrl(value);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
context.addIssue({ code: 'custom', message: 'The authentication result was rejected.' });
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export const AssistantAuthOutputSchema = z.discriminatedUnion('status', [
|
|
15
|
+
z.object({
|
|
16
|
+
status: z.literal('pending'),
|
|
17
|
+
environment: authEnvironment,
|
|
18
|
+
loginUrl: safeDeviceLoginUrl.nullable(),
|
|
19
|
+
userCode: z.string().trim().regex(/^[A-Z0-9-]{4,32}$/iu).optional(),
|
|
20
|
+
expiresAt: z.iso.datetime().optional(),
|
|
21
|
+
message: authMessage
|
|
22
|
+
}).strict(),
|
|
23
|
+
...['authenticated', 'not_authenticated', 'failed'].map((status) => z.object({
|
|
24
|
+
status: z.literal(status),
|
|
25
|
+
environment: authEnvironment,
|
|
26
|
+
loginUrl: z.null(),
|
|
27
|
+
userCode: z.never().optional(),
|
|
28
|
+
expiresAt: z.never().optional(),
|
|
29
|
+
message: authMessage
|
|
30
|
+
}).strict())
|
|
31
|
+
]).superRefine((value, context) => {
|
|
32
|
+
if (value.status !== 'pending')
|
|
33
|
+
return;
|
|
34
|
+
const hasPrompt = value.loginUrl !== null;
|
|
35
|
+
if (hasPrompt !== (value.userCode !== undefined) || hasPrompt !== (value.expiresAt !== undefined)) {
|
|
36
|
+
context.addIssue({ code: 'custom', message: 'The authentication result has an invalid pending state.' });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
function normalizeAuthMessage(value) {
|
|
40
|
+
return value.normalize('NFKC').replace(/[\u200B-\u200D\u2060\uFEFF]/gu, '').replace(/\s+/gu, ' ');
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=auth-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-schema.js","sourceRoot":"","sources":["../src/auth-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/C,MAAM,qBAAqB,GACzB,2PAA2P,CAAC;AAE9P,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,G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CAAC,IAAI,EAAE;QAClB,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QAC9B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QAC/B,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC,MAAM,EAAE,CAAC;CACb,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAChC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO;IACvC,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;IAC1C,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,EAAE,CAAC;QAClG,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,yDAAyD,EAAE,CAAC,CAAC;IAC3G,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import type { AssistantAuthResult } from './auth.js';
|
|
3
|
+
export declare const LOCAL_AUTH_TOOL_NAMES: readonly ["databasin_auth_status", "databasin_login"];
|
|
4
|
+
type AuthTools = Readonly<{
|
|
5
|
+
startLogin(): Promise<AssistantAuthResult>;
|
|
6
|
+
getLoginStatus(): Promise<AssistantAuthResult>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function registerAuthTools(server: McpServer, auth: AuthTools): void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=auth-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-tools.d.ts","sourceRoot":"","sources":["../src/auth-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,8BAA8B,CAAC;AAE7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAMrD,eAAO,MAAM,qBAAqB,uDAGvB,CAAC;AAEZ,KAAK,SAAS,GAAG,QAAQ,CAAC;IACxB,UAAU,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC3C,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAChD,CAAC,CAAC;AAKH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAgB1E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z, ZodError } from 'zod';
|
|
2
|
+
import { AssistantAuthOutputSchema } from './auth-schema.js';
|
|
3
|
+
import { safeCorrelationId } from './correlation.js';
|
|
4
|
+
import { DataBasinError, publicError } from './errors.js';
|
|
5
|
+
import { assertSafeOutput, sanitizeOutput } from './safety.js';
|
|
6
|
+
export const LOCAL_AUTH_TOOL_NAMES = Object.freeze([
|
|
7
|
+
'databasin_auth_status',
|
|
8
|
+
'databasin_login'
|
|
9
|
+
]);
|
|
10
|
+
const emptyInput = z.object({}).strict();
|
|
11
|
+
const annotations = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
12
|
+
export function registerAuthTools(server, auth) {
|
|
13
|
+
server.registerTool(LOCAL_AUTH_TOOL_NAMES[0], {
|
|
14
|
+
title: 'Check DataBasin sign-in',
|
|
15
|
+
description: 'Check local sign-in state without returning account identity or credentials.',
|
|
16
|
+
inputSchema: emptyInput,
|
|
17
|
+
outputSchema: AssistantAuthOutputSchema,
|
|
18
|
+
annotations
|
|
19
|
+
}, async (_input, context) => authToolResult(() => auth.getLoginStatus(), context));
|
|
20
|
+
server.registerTool(LOCAL_AUTH_TOOL_NAMES[1], {
|
|
21
|
+
title: 'Sign in to DataBasin',
|
|
22
|
+
description: 'Start Microsoft device sign-in. Enter credentials only on Microsoft\'s page; never provide credentials in chat.',
|
|
23
|
+
inputSchema: emptyInput,
|
|
24
|
+
outputSchema: AssistantAuthOutputSchema,
|
|
25
|
+
annotations: { ...annotations, readOnlyHint: false, openWorldHint: true }
|
|
26
|
+
}, async (_input, context) => authToolResult(() => auth.startLogin(), context));
|
|
27
|
+
}
|
|
28
|
+
async function authToolResult(operation, _context) {
|
|
29
|
+
try {
|
|
30
|
+
const output = AssistantAuthOutputSchema.parse(sanitizeOutput(await operation()));
|
|
31
|
+
const result = { ...output, message: authOutputMessage(output) };
|
|
32
|
+
assertSafeOutput(result);
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
35
|
+
structuredContent: result
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const normalized = error instanceof ZodError
|
|
40
|
+
? new DataBasinError('INVALID_ARGUMENT', error.issues[0]?.message ?? 'The tool arguments are invalid.')
|
|
41
|
+
: error;
|
|
42
|
+
const visible = publicError(normalized);
|
|
43
|
+
const { correlationId, ...publicFields } = visible;
|
|
44
|
+
const safe = { ...publicFields, correlationId: safeCorrelationId(correlationId) };
|
|
45
|
+
return { content: [{ type: 'text', text: JSON.stringify(safe) }], isError: true };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function authOutputMessage(output) {
|
|
49
|
+
if (output.status === 'pending') {
|
|
50
|
+
return output.loginUrl === null
|
|
51
|
+
? 'Microsoft is preparing the device sign-in instructions.'
|
|
52
|
+
: 'Microsoft device sign-in is ready. Use the approved login URL and user code, then call databasin_auth_status.';
|
|
53
|
+
}
|
|
54
|
+
if (output.status === 'authenticated')
|
|
55
|
+
return 'DataBasin sign-in is complete.';
|
|
56
|
+
if (output.status === 'not_authenticated')
|
|
57
|
+
return 'DataBasin is not signed in. Call databasin_login to begin.';
|
|
58
|
+
return 'DataBasin sign-in did not complete. Call databasin_login to try again.';
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=auth-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-tools.js","sourceRoot":"","sources":["../src/auth-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,uBAAuB;IACvB,iBAAiB;CACT,CAAC,CAAC;AAOZ,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AACzC,MAAM,WAAW,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAEzF,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,IAAe;IAClE,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE;QAC5C,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,8EAA8E;QAC3F,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,yBAAyB;QACvC,WAAW;KACZ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;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AAO,CAAC;QACnD,MAAM,IAAI,GAAG,EAAE,GAAG,YAAY,EAAE,aAAa,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAE,CAAC;QAClF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;IACtG,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA0E;IACnG,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,QAAQ,KAAK,IAAI;YAC7B,CAAC,CAAC,yDAAyD;YAC3D,CAAC,CAAC,+GAA+G,CAAC;IACtH,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,eAAe;QAAE,OAAO,gCAAgC,CAAC;IAC/E,IAAI,MAAM,CAAC,MAAM,KAAK,mBAAmB;QAAE,OAAO,4DAA4D,CAAC;IAC/G,OAAO,wEAAwE,CAAC;AAClF,CAAC"}
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import { type AccountInfo, type AuthenticationResult
|
|
1
|
+
import { type AccountInfo, type AuthenticationResult } from '@azure/msal-node';
|
|
2
2
|
import { type DataBasinEnvironment, type DataBasinProfile } from './config.js';
|
|
3
|
+
import { type RawDeviceCodeResponse } from './login-url.js';
|
|
3
4
|
export interface AuthStatus {
|
|
4
5
|
authenticated: boolean;
|
|
5
6
|
environment: DataBasinEnvironment;
|
|
6
7
|
username?: string;
|
|
7
8
|
}
|
|
8
9
|
export type AssistantAuthState = 'authenticated' | 'pending' | 'not_authenticated' | 'failed';
|
|
9
|
-
|
|
10
|
-
status: AssistantAuthState;
|
|
10
|
+
interface AssistantAuthResultBase {
|
|
11
11
|
environment: DataBasinEnvironment;
|
|
12
|
+
message: string;
|
|
13
|
+
}
|
|
14
|
+
interface PendingAssistantAuthResult extends AssistantAuthResultBase {
|
|
15
|
+
status: 'pending';
|
|
12
16
|
loginUrl: string | null;
|
|
13
17
|
userCode?: string;
|
|
14
18
|
expiresAt?: string;
|
|
15
|
-
message: string;
|
|
16
19
|
}
|
|
17
|
-
interface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
interface SettledAssistantAuthResult extends AssistantAuthResultBase {
|
|
21
|
+
status: Exclude<AssistantAuthState, 'pending'>;
|
|
22
|
+
loginUrl: null;
|
|
23
|
+
userCode?: never;
|
|
24
|
+
expiresAt?: never;
|
|
21
25
|
}
|
|
26
|
+
export type AssistantAuthResult = PendingAssistantAuthResult | SettledAssistantAuthResult;
|
|
22
27
|
export interface PublicClientLike {
|
|
23
28
|
getAllAccounts(): Promise<AccountInfo[]>;
|
|
24
29
|
acquireTokenSilent(request: {
|
|
@@ -35,7 +40,8 @@ export interface PublicClientLike {
|
|
|
35
40
|
acquireTokenByDeviceCode(request: {
|
|
36
41
|
scopes: string[];
|
|
37
42
|
timeout?: number;
|
|
38
|
-
|
|
43
|
+
cancel?: boolean;
|
|
44
|
+
deviceCodeCallback: (response: RawDeviceCodeResponse) => void;
|
|
39
45
|
}): Promise<AuthenticationResult | null>;
|
|
40
46
|
signOut(request: {
|
|
41
47
|
account: AccountInfo;
|
|
@@ -44,6 +50,7 @@ export interface PublicClientLike {
|
|
|
44
50
|
export interface AuthManagerOptions {
|
|
45
51
|
createClient?: () => Promise<PublicClientLike>;
|
|
46
52
|
openBrowser?: (url: string) => Promise<void>;
|
|
53
|
+
now?: () => number;
|
|
47
54
|
}
|
|
48
55
|
export declare class AuthManager {
|
|
49
56
|
readonly profile: DataBasinProfile;
|
|
@@ -53,11 +60,16 @@ export declare class AuthManager {
|
|
|
53
60
|
private lastLoginFailed;
|
|
54
61
|
private readonly createClient;
|
|
55
62
|
private readonly openBrowser;
|
|
63
|
+
private readonly now;
|
|
56
64
|
constructor(profile: DataBasinProfile, options?: AuthManagerOptions);
|
|
57
65
|
getAccessToken(): Promise<string>;
|
|
58
66
|
login(): Promise<AuthStatus>;
|
|
59
67
|
startLogin(): Promise<AssistantAuthResult>;
|
|
68
|
+
cancelPendingLogin(): void;
|
|
60
69
|
getLoginStatus(): Promise<AssistantAuthResult>;
|
|
70
|
+
private pendingAssistantResult;
|
|
71
|
+
private cachedAssistantResult;
|
|
72
|
+
private failedAssistantResult;
|
|
61
73
|
private beginDeviceLogin;
|
|
62
74
|
private performDeviceLogin;
|
|
63
75
|
private performInteractiveLogin;
|
|
@@ -68,6 +80,5 @@ export declare class AuthManager {
|
|
|
68
80
|
private acquireSilent;
|
|
69
81
|
private client;
|
|
70
82
|
}
|
|
71
|
-
export
|
|
72
|
-
export {};
|
|
83
|
+
export { createSecurePublicClient } from './credential-store.js';
|
|
73
84
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/E,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,oBAAoB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,SAAS,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AAE9F,UAAU,uBAAuB;IAC/B,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,EAAE,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