@marchward/mcp-server 0.2.2

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.
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Marchward MCP Server — Tool definitions
3
+ *
4
+ * Each tool maps to a Marchward API capability. These tools let
5
+ * AI coding agents (Claude, Cursor, Copilot, etc.):
6
+ * 1. Check governance before taking actions (marchward_authorize)
7
+ * 2. Execute actions through Marchward's credential gateway (marchward_execute)
8
+ * 3. Register and manage agents (marchward_register_agent, marchward_list_agents)
9
+ * 4. Inspect decisions (marchward_get_decisions)
10
+ * 5. Check governance coverage (marchward_check_coverage)
11
+ * 6. Bind policies to agents (marchward_bind_policy)
12
+ *
13
+ * Tool names are marchward_* (stable as of v0.2.0). MCP clients discover
14
+ * tools dynamically at runtime; the names are not dual-listed because
15
+ * duplicate tools degrade agent tool-selection.
16
+ */
17
+ import { z } from "zod";
18
+ import { MarchwardAPIClient } from "./api-client.js";
19
+ export declare const TOOL_DEFINITIONS: {
20
+ readonly marchward_authorize: {
21
+ readonly name: "marchward_authorize";
22
+ readonly description: "Check whether an action is allowed BEFORE the agent takes it. Call this first for any consequential or irreversible action (deploying, committing, publishing, deleting, moving money, calling an external API). Returns ALLOW, BLOCK, ESCALATE, or ALLOW_WITH_CONDITIONS, and writes a tamper-evident audit record. The agent and policy are resolved from your API key, so you usually only pass toolName.";
23
+ readonly inputSchema: z.ZodObject<{
24
+ toolName: z.ZodString;
25
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
+ policyBundleId: z.ZodOptional<z.ZodString>;
27
+ agentId: z.ZodOptional<z.ZodString>;
28
+ mode: z.ZodOptional<z.ZodEnum<["HIC", "HITL", "HOTL"]>>;
29
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ toolName: string;
32
+ agentId?: string | undefined;
33
+ arguments?: Record<string, unknown> | undefined;
34
+ policyBundleId?: string | undefined;
35
+ mode?: "HIC" | "HITL" | "HOTL" | undefined;
36
+ context?: Record<string, unknown> | undefined;
37
+ }, {
38
+ toolName: string;
39
+ agentId?: string | undefined;
40
+ arguments?: Record<string, unknown> | undefined;
41
+ policyBundleId?: string | undefined;
42
+ mode?: "HIC" | "HITL" | "HOTL" | undefined;
43
+ context?: Record<string, unknown> | undefined;
44
+ }>;
45
+ };
46
+ readonly marchward_execute: {
47
+ readonly name: "marchward_execute";
48
+ readonly description: "Run an action through Marchward's credential-mediated gateway. Marchward evaluates policy, injects the real downstream credential server-side (the agent never holds it), enforces the cost cap and approval gates, then makes the call and records it. Use this for any call to a service whose credentials Marchward manages (GitHub, Stripe, Notion, etc.).";
49
+ readonly inputSchema: z.ZodObject<{
50
+ toolName: z.ZodString;
51
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ policyBundleId: z.ZodString;
53
+ agentId: z.ZodString;
54
+ service: z.ZodString;
55
+ downstream: z.ZodObject<{
56
+ url: z.ZodString;
57
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
58
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
59
+ body: z.ZodOptional<z.ZodUnknown>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
62
+ url: string;
63
+ headers?: Record<string, string> | undefined;
64
+ body?: unknown;
65
+ }, {
66
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
67
+ url: string;
68
+ headers?: Record<string, string> | undefined;
69
+ body?: unknown;
70
+ }>;
71
+ mode: z.ZodOptional<z.ZodEnum<["HIC", "HITL", "HOTL"]>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ agentId: string;
74
+ toolName: string;
75
+ policyBundleId: string;
76
+ service: string;
77
+ downstream: {
78
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
79
+ url: string;
80
+ headers?: Record<string, string> | undefined;
81
+ body?: unknown;
82
+ };
83
+ arguments?: Record<string, unknown> | undefined;
84
+ mode?: "HIC" | "HITL" | "HOTL" | undefined;
85
+ }, {
86
+ agentId: string;
87
+ toolName: string;
88
+ policyBundleId: string;
89
+ service: string;
90
+ downstream: {
91
+ method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
92
+ url: string;
93
+ headers?: Record<string, string> | undefined;
94
+ body?: unknown;
95
+ };
96
+ arguments?: Record<string, unknown> | undefined;
97
+ mode?: "HIC" | "HITL" | "HOTL" | undefined;
98
+ }>;
99
+ };
100
+ readonly marchward_register_agent: {
101
+ readonly name: "marchward_register_agent";
102
+ readonly description: "Register a new agent with Marchward so it is governed from its first action. Returns the agent record and its Marchward API key — the only credential the agent should hold. Call this when building or deploying a new agent.";
103
+ readonly inputSchema: z.ZodObject<{
104
+ name: z.ZodString;
105
+ description: z.ZodOptional<z.ZodString>;
106
+ agentId: z.ZodOptional<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ name: string;
109
+ agentId?: string | undefined;
110
+ description?: string | undefined;
111
+ }, {
112
+ name: string;
113
+ agentId?: string | undefined;
114
+ description?: string | undefined;
115
+ }>;
116
+ };
117
+ readonly marchward_list_agents: {
118
+ readonly name: "marchward_list_agents";
119
+ readonly description: "List the agents registered under your account, with their IDs, status, last-seen time, and bound policy. Use to find an agentId or check what is under governance.";
120
+ readonly inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
121
+ };
122
+ readonly marchward_get_decisions: {
123
+ readonly name: "marchward_get_decisions";
124
+ readonly description: "Review recent governance decisions (the audit trail). Filter by agent, tool name, or outcome (ALLOW/BLOCK/ESCALATE). Use to verify governance is active or to investigate what an agent actually did.";
125
+ readonly inputSchema: z.ZodObject<{
126
+ agentId: z.ZodOptional<z.ZodString>;
127
+ toolName: z.ZodOptional<z.ZodString>;
128
+ result: z.ZodOptional<z.ZodEnum<["ALLOW", "BLOCK", "ESCALATE", "ALLOW_WITH_CONDITIONS"]>>;
129
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ limit: number;
132
+ agentId?: string | undefined;
133
+ toolName?: string | undefined;
134
+ result?: "ALLOW" | "BLOCK" | "ESCALATE" | "ALLOW_WITH_CONDITIONS" | undefined;
135
+ }, {
136
+ agentId?: string | undefined;
137
+ toolName?: string | undefined;
138
+ result?: "ALLOW" | "BLOCK" | "ESCALATE" | "ALLOW_WITH_CONDITIONS" | undefined;
139
+ limit?: number | undefined;
140
+ }>;
141
+ };
142
+ readonly marchward_check_coverage: {
143
+ readonly name: "marchward_check_coverage";
144
+ readonly description: "Find governance gaps for an agent by comparing its declared tools against the tools it has actually called. Returns a coverage percentage and the uncovered tools, so ungoverned actions surface before they cause harm. This is the 'Dependabot for governance'.";
145
+ readonly inputSchema: z.ZodObject<{
146
+ agentId: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ agentId: string;
149
+ }, {
150
+ agentId: string;
151
+ }>;
152
+ };
153
+ readonly marchward_bind_policy: {
154
+ readonly name: "marchward_bind_policy";
155
+ readonly description: "Attach a governance policy to an agent. After binding, every authorize and execute call from that agent is evaluated against this policy.";
156
+ readonly inputSchema: z.ZodObject<{
157
+ agentId: z.ZodString;
158
+ policyBundleId: z.ZodString;
159
+ }, "strip", z.ZodTypeAny, {
160
+ agentId: string;
161
+ policyBundleId: string;
162
+ }, {
163
+ agentId: string;
164
+ policyBundleId: string;
165
+ }>;
166
+ };
167
+ };
168
+ export declare function createToolHandlers(client: MarchwardAPIClient): {
169
+ marchward_authorize(args: z.infer<typeof TOOL_DEFINITIONS.marchward_authorize.inputSchema>): Promise<{
170
+ content: {
171
+ type: "text";
172
+ text: string;
173
+ }[];
174
+ }>;
175
+ marchward_execute(args: z.infer<typeof TOOL_DEFINITIONS.marchward_execute.inputSchema>): Promise<{
176
+ content: {
177
+ type: "text";
178
+ text: string;
179
+ }[];
180
+ }>;
181
+ marchward_register_agent(args: z.infer<typeof TOOL_DEFINITIONS.marchward_register_agent.inputSchema>): Promise<{
182
+ content: {
183
+ type: "text";
184
+ text: string;
185
+ }[];
186
+ }>;
187
+ marchward_list_agents(_args: z.infer<typeof TOOL_DEFINITIONS.marchward_list_agents.inputSchema>): Promise<{
188
+ content: {
189
+ type: "text";
190
+ text: string;
191
+ }[];
192
+ }>;
193
+ marchward_get_decisions(args: z.infer<typeof TOOL_DEFINITIONS.marchward_get_decisions.inputSchema>): Promise<{
194
+ content: {
195
+ type: "text";
196
+ text: string;
197
+ }[];
198
+ }>;
199
+ marchward_check_coverage(args: z.infer<typeof TOOL_DEFINITIONS.marchward_check_coverage.inputSchema>): Promise<{
200
+ content: {
201
+ type: "text";
202
+ text: string;
203
+ }[];
204
+ }>;
205
+ marchward_bind_policy(args: z.infer<typeof TOOL_DEFINITIONS.marchward_bind_policy.inputSchema>): Promise<{
206
+ content: {
207
+ type: "text";
208
+ text: string;
209
+ }[];
210
+ }>;
211
+ };
package/dist/tools.js ADDED
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Marchward MCP Server — Tool definitions
3
+ *
4
+ * Each tool maps to a Marchward API capability. These tools let
5
+ * AI coding agents (Claude, Cursor, Copilot, etc.):
6
+ * 1. Check governance before taking actions (marchward_authorize)
7
+ * 2. Execute actions through Marchward's credential gateway (marchward_execute)
8
+ * 3. Register and manage agents (marchward_register_agent, marchward_list_agents)
9
+ * 4. Inspect decisions (marchward_get_decisions)
10
+ * 5. Check governance coverage (marchward_check_coverage)
11
+ * 6. Bind policies to agents (marchward_bind_policy)
12
+ *
13
+ * Tool names are marchward_* (stable as of v0.2.0). MCP clients discover
14
+ * tools dynamically at runtime; the names are not dual-listed because
15
+ * duplicate tools degrade agent tool-selection.
16
+ */
17
+ import { z } from "zod";
18
+ // ─── Tool Schemas ───────────────────────────────────────────────
19
+ export const TOOL_DEFINITIONS = {
20
+ marchward_authorize: {
21
+ name: "marchward_authorize",
22
+ description: "Check whether an action is allowed BEFORE the agent takes it. Call this first for any consequential or irreversible action (deploying, committing, publishing, deleting, moving money, calling an external API). Returns ALLOW, BLOCK, ESCALATE, or ALLOW_WITH_CONDITIONS, and writes a tamper-evident audit record. The agent and policy are resolved from your API key, so you usually only pass toolName.",
23
+ inputSchema: z.object({
24
+ toolName: z
25
+ .string()
26
+ .describe("Name of the tool/action being authorized (e.g. 'github_commit', 'railway_deploy', 'notion_update')"),
27
+ arguments: z
28
+ .record(z.unknown())
29
+ .optional()
30
+ .describe("Arguments/parameters for the tool call"),
31
+ policyBundleId: z
32
+ .string()
33
+ .optional()
34
+ .describe("ID of the policy bundle to evaluate against (auto-resolved from API key → agent → policy if omitted)"),
35
+ agentId: z
36
+ .string()
37
+ .optional()
38
+ .describe("Agent ID (auto-resolved from API key if omitted)"),
39
+ mode: z
40
+ .enum(["HIC", "HITL", "HOTL"])
41
+ .optional()
42
+ .describe("Governance mode: HIC (human-in-command), HITL (human-in-the-loop), HOTL (human-on-the-loop)"),
43
+ context: z
44
+ .record(z.unknown())
45
+ .optional()
46
+ .describe("Additional context for policy evaluation"),
47
+ }),
48
+ },
49
+ marchward_execute: {
50
+ name: "marchward_execute",
51
+ description: "Run an action through Marchward's credential-mediated gateway. Marchward evaluates policy, injects the real downstream credential server-side (the agent never holds it), enforces the cost cap and approval gates, then makes the call and records it. Use this for any call to a service whose credentials Marchward manages (GitHub, Stripe, Notion, etc.).",
52
+ inputSchema: z.object({
53
+ toolName: z
54
+ .string()
55
+ .describe("Name of the tool/action being executed"),
56
+ arguments: z
57
+ .record(z.unknown())
58
+ .optional()
59
+ .describe("Arguments for the tool call"),
60
+ policyBundleId: z
61
+ .string()
62
+ .describe("Policy bundle ID to evaluate against"),
63
+ agentId: z.string().describe("Agent ID making the request"),
64
+ service: z
65
+ .string()
66
+ .describe("Service name for credential injection (e.g. 'github', 'railway', 'notion')"),
67
+ downstream: z.object({
68
+ url: z.string().describe("Full URL for the downstream API call"),
69
+ method: z
70
+ .enum(["GET", "POST", "PUT", "PATCH", "DELETE"])
71
+ .describe("HTTP method"),
72
+ headers: z
73
+ .record(z.string())
74
+ .optional()
75
+ .describe("Additional headers"),
76
+ body: z.unknown().optional().describe("Request body"),
77
+ }),
78
+ mode: z.enum(["HIC", "HITL", "HOTL"]).optional(),
79
+ }),
80
+ },
81
+ marchward_register_agent: {
82
+ name: "marchward_register_agent",
83
+ description: "Register a new agent with Marchward so it is governed from its first action. Returns the agent record and its Marchward API key — the only credential the agent should hold. Call this when building or deploying a new agent.",
84
+ inputSchema: z.object({
85
+ name: z.string().describe("Human-readable name for the agent"),
86
+ description: z
87
+ .string()
88
+ .optional()
89
+ .describe("Description of what the agent does"),
90
+ agentId: z
91
+ .string()
92
+ .optional()
93
+ .describe("Custom agent ID (auto-generated from name if omitted)"),
94
+ }),
95
+ },
96
+ marchward_list_agents: {
97
+ name: "marchward_list_agents",
98
+ description: "List the agents registered under your account, with their IDs, status, last-seen time, and bound policy. Use to find an agentId or check what is under governance.",
99
+ inputSchema: z.object({}),
100
+ },
101
+ marchward_get_decisions: {
102
+ name: "marchward_get_decisions",
103
+ description: "Review recent governance decisions (the audit trail). Filter by agent, tool name, or outcome (ALLOW/BLOCK/ESCALATE). Use to verify governance is active or to investigate what an agent actually did.",
104
+ inputSchema: z.object({
105
+ agentId: z
106
+ .string()
107
+ .optional()
108
+ .describe("Filter decisions by agent ID"),
109
+ toolName: z
110
+ .string()
111
+ .optional()
112
+ .describe("Filter decisions by tool name"),
113
+ result: z
114
+ .enum(["ALLOW", "BLOCK", "ESCALATE", "ALLOW_WITH_CONDITIONS"])
115
+ .optional()
116
+ .describe("Filter by decision outcome"),
117
+ limit: z
118
+ .number()
119
+ .optional()
120
+ .default(20)
121
+ .describe("Number of decisions to return (default 20)"),
122
+ }),
123
+ },
124
+ marchward_check_coverage: {
125
+ name: "marchward_check_coverage",
126
+ description: "Find governance gaps for an agent by comparing its declared tools against the tools it has actually called. Returns a coverage percentage and the uncovered tools, so ungoverned actions surface before they cause harm. This is the 'Dependabot for governance'.",
127
+ inputSchema: z.object({
128
+ agentId: z.string().describe("Agent ID to check coverage for"),
129
+ }),
130
+ },
131
+ marchward_bind_policy: {
132
+ name: "marchward_bind_policy",
133
+ description: "Attach a governance policy to an agent. After binding, every authorize and execute call from that agent is evaluated against this policy.",
134
+ inputSchema: z.object({
135
+ agentId: z.string().describe("Agent ID to bind the policy to"),
136
+ policyBundleId: z.string().describe("Policy bundle ID to bind"),
137
+ }),
138
+ },
139
+ };
140
+ // ─── Tool Handlers ──────────────────────────────────────────────
141
+ export function createToolHandlers(client) {
142
+ return {
143
+ async marchward_authorize(args) {
144
+ const result = await client.authorize(args);
145
+ const decision = result.result ?? result.decision ?? "UNKNOWN";
146
+ const decisionId = result.decisionId ?? "";
147
+ const explanation = result.explanation ?? [];
148
+ return {
149
+ content: [
150
+ {
151
+ type: "text",
152
+ text: JSON.stringify({
153
+ decision,
154
+ decisionId,
155
+ explanation,
156
+ toolName: args.toolName,
157
+ ...(args.policyBundleId ? { policyBundleId: args.policyBundleId } : {}),
158
+ full: result,
159
+ }, null, 2),
160
+ },
161
+ ],
162
+ };
163
+ },
164
+ async marchward_execute(args) {
165
+ const result = await client.execute(args);
166
+ return {
167
+ content: [
168
+ {
169
+ type: "text",
170
+ text: JSON.stringify(result, null, 2),
171
+ },
172
+ ],
173
+ };
174
+ },
175
+ async marchward_register_agent(args) {
176
+ const result = await client.createAgent(args);
177
+ return {
178
+ content: [
179
+ {
180
+ type: "text",
181
+ text: JSON.stringify({
182
+ message: `Agent "${args.name}" registered successfully.`,
183
+ ...result,
184
+ }, null, 2),
185
+ },
186
+ ],
187
+ };
188
+ },
189
+ async marchward_list_agents(_args) {
190
+ const result = await client.listAgents();
191
+ return {
192
+ content: [
193
+ {
194
+ type: "text",
195
+ text: JSON.stringify(result, null, 2),
196
+ },
197
+ ],
198
+ };
199
+ },
200
+ async marchward_get_decisions(args) {
201
+ const result = await client.listDecisions(args);
202
+ return {
203
+ content: [
204
+ {
205
+ type: "text",
206
+ text: JSON.stringify(result, null, 2),
207
+ },
208
+ ],
209
+ };
210
+ },
211
+ async marchward_check_coverage(args) {
212
+ const result = await client.checkCoverage(args.agentId);
213
+ return {
214
+ content: [
215
+ {
216
+ type: "text",
217
+ text: JSON.stringify(result, null, 2),
218
+ },
219
+ ],
220
+ };
221
+ },
222
+ async marchward_bind_policy(args) {
223
+ const result = await client.bindPolicy(args.agentId, args.policyBundleId);
224
+ return {
225
+ content: [
226
+ {
227
+ type: "text",
228
+ text: JSON.stringify({
229
+ message: `Policy "${args.policyBundleId}" bound to agent "${args.agentId}".`,
230
+ ...result,
231
+ }, null, 2),
232
+ },
233
+ ],
234
+ };
235
+ },
236
+ };
237
+ }
238
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,mEAAmE;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,mBAAmB,EAAE;QACnB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,8YAA8Y;QAChZ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,CACP,oGAAoG,CACrG;YACH,SAAS,EAAE,CAAC;iBACT,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;iBACnB,QAAQ,EAAE;iBACV,QAAQ,CAAC,wCAAwC,CAAC;YACrD,cAAc,EAAE,CAAC;iBACd,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,sGAAsG,CAAC;YACnH,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,kDAAkD,CAAC;YAC/D,IAAI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gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,wBAAwB,CAAC,IAA2E;YACxG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,qBAAqB,CAAC,IAAwE;YAClG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CACpC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,CACpB,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO,EAAE,WAAW,IAAI,CAAC,cAAc,qBAAqB,IAAI,CAAC,OAAO,IAAI;4BAC5E,GAAG,MAAM;yBACV,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
package/glama.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://glama.ai/mcp/schemas/server.json",
3
+ "maintainers": ["marchward"]
4
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@marchward/mcp-server",
3
+ "version": "0.2.2",
4
+ "description": "Marchward MCP Server: governance layer for AI coding agents via Model Context Protocol",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "start": "node dist/index.js",
11
+ "dev": "npx tsx src/index.ts",
12
+ "clean": "rm -rf dist",
13
+ "prepublishOnly": "npm run clean && npm run build"
14
+ },
15
+ "dependencies": {
16
+ "@modelcontextprotocol/sdk": "^1.12.1",
17
+ "express": "^4.21.0",
18
+ "zod": "^3.23.0"
19
+ },
20
+ "devDependencies": {
21
+ "@types/express": "^5.0.0",
22
+ "@types/node": "^22.0.0",
23
+ "tsx": "^4.19.0",
24
+ "typescript": "^5.6.0"
25
+ },
26
+ "engines": {
27
+ "node": ">=20.0.0"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "src",
32
+ "README.md",
33
+ "glama.json"
34
+ ]
35
+ }