@gitpagedocs/mcp 1.1.55 → 1.1.56

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/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "@gitpagedocs/mcp",
3
- "version": "1.1.55",
4
- "type": "module",
5
- "description": "Model Context Protocol server for Git Page Docs (delegates to @gitpagedocs/tools). Ships TypeScript source; run via tsx.",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "files": [
9
- "src",
10
- "README.md"
11
- ],
12
- "engines": {
13
- "node": ">=20"
14
- },
15
- "scripts": {
16
- "typecheck": "tsc --noEmit -p tsconfig.json"
17
- },
18
- "dependencies": {
19
- "@gitpagedocs/tools": "^1.1.54",
20
- "@modelcontextprotocol/sdk": "^1.12.0",
21
- "zod": "^3.23.8"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/Vidigal-code/git-page-docs.git",
26
- "directory": "mcp"
27
- },
28
- "author": "Vidigal-code",
29
- "license": "ISC",
30
- "publishConfig": {
31
- "access": "public"
32
- }
33
- }
1
+ {
2
+ "name": "@gitpagedocs/mcp",
3
+ "version": "1.1.56",
4
+ "type": "module",
5
+ "description": "Model Context Protocol server for Git Page Docs (delegates to @gitpagedocs/tools). Ships TypeScript source; run via tsx.",
6
+ "main": "./src/index.ts",
7
+ "types": "./src/index.ts",
8
+ "files": [
9
+ "src",
10
+ "README.md"
11
+ ],
12
+ "engines": {
13
+ "node": ">=20"
14
+ },
15
+ "dependencies": {
16
+ "@gitpagedocs/tools": "^1.1.56",
17
+ "@modelcontextprotocol/sdk": "^1.12.0",
18
+ "zod": "^3.23.8"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Vidigal-code/git-page-docs.git",
23
+ "directory": "mcp"
24
+ },
25
+ "author": "Vidigal-code",
26
+ "license": "ISC",
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "typecheck": "tsc --noEmit -p tsconfig.json"
32
+ }
33
+ }
package/src/context.ts CHANGED
@@ -14,7 +14,8 @@ import {
14
14
  type ProviderConfig,
15
15
  } from "@gitpagedocs/tools";
16
16
 
17
- const ENV_KEYS: Record<AiProviderId, string[]> = {
17
+ /** Environment variable names checked per provider (exported for tooling/tests). */
18
+ export const PROVIDER_ENV_KEYS: Record<AiProviderId, string[]> = {
18
19
  openai: ["OPENAI_API_KEY"],
19
20
  anthropic: ["ANTHROPIC_API_KEY", "CLAUDE_API_KEY"],
20
21
  gemini: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
@@ -66,7 +67,7 @@ export class ServerContext {
66
67
  }
67
68
 
68
69
  private resolveKey(providerId: AiProviderId): string | undefined {
69
- for (const name of ENV_KEYS[providerId]) {
70
+ for (const name of PROVIDER_ENV_KEYS[providerId]) {
70
71
  const value = process.env[name];
71
72
  if (value) return value;
72
73
  }
@@ -85,7 +86,7 @@ export class ServerContext {
85
86
  const apiKey = this.resolveKey(id);
86
87
  if (spec.auth !== "none" && !apiKey) {
87
88
  throw new ProviderError(
88
- `No API key for ${spec.label}. Set ${ENV_KEYS[id].join(" or ")} in the environment.`,
89
+ `No API key for ${spec.label}. Set ${PROVIDER_ENV_KEYS[id].join(" or ")} in the environment.`,
89
90
  );
90
91
  }
91
92
  const baseUrl =
package/src/server.ts CHANGED
@@ -7,10 +7,11 @@ import { registerResources } from "./resources/register-resources";
7
7
 
8
8
  export const SERVER_INFO = { name: "gitpagedocs-mcp", version: "0.1.0" } as const;
9
9
 
10
- /** Build the MCP server with every tool and resource registered. */
11
- export function createServer(root: string = process.cwd()): McpServer {
10
+ /** Build the MCP server with every tool and resource registered.
11
+ * The context is injectable so integration tests can supply deterministic
12
+ * provider resolution without touching the network. */
13
+ export function createServer(root: string = process.cwd(), ctx: ServerContext = new ServerContext(root)): McpServer {
12
14
  const server = new McpServer(SERVER_INFO);
13
- const ctx = new ServerContext(root);
14
15
 
15
16
  registerFilesystemTools(server, ctx);
16
17
  registerAiTools(server, ctx);