@y2-intel/mcp 0.1.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +190 -0
  3. package/README.md +136 -0
  4. package/SECURITY.md +12 -0
  5. package/dist/config.d.ts +14 -0
  6. package/dist/config.js +47 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/errors.d.ts +12 -0
  9. package/dist/errors.js +25 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.js +16 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/docs.d.ts +3 -0
  15. package/dist/resources/docs.js +50 -0
  16. package/dist/resources/docs.js.map +1 -0
  17. package/dist/server.d.ts +3 -0
  18. package/dist/server.js +26 -0
  19. package/dist/server.js.map +1 -0
  20. package/dist/stream.d.ts +1 -0
  21. package/dist/stream.js +74 -0
  22. package/dist/stream.js.map +1 -0
  23. package/dist/text.d.ts +16 -0
  24. package/dist/text.js +21 -0
  25. package/dist/text.js.map +1 -0
  26. package/dist/tools/ask-agent.d.ts +4 -0
  27. package/dist/tools/ask-agent.js +26 -0
  28. package/dist/tools/ask-agent.js.map +1 -0
  29. package/dist/tools/news.d.ts +4 -0
  30. package/dist/tools/news.js +33 -0
  31. package/dist/tools/news.js.map +1 -0
  32. package/dist/tools/openapi.d.ts +5 -0
  33. package/dist/tools/openapi.js +67 -0
  34. package/dist/tools/openapi.js.map +1 -0
  35. package/dist/tools/prompts.d.ts +2 -0
  36. package/dist/tools/prompts.js +52 -0
  37. package/dist/tools/prompts.js.map +1 -0
  38. package/dist/tools/reports.d.ts +4 -0
  39. package/dist/tools/reports.js +35 -0
  40. package/dist/tools/reports.js.map +1 -0
  41. package/dist/y2-client.d.ts +32 -0
  42. package/dist/y2-client.js +144 -0
  43. package/dist/y2-client.js.map +1 -0
  44. package/examples/claude-code.md +22 -0
  45. package/examples/claude-desktop.json +12 -0
  46. package/examples/codex.md +28 -0
  47. package/examples/mcp-inspector.md +53 -0
  48. package/package.json +71 -0
  49. package/server.json +17 -0
@@ -0,0 +1,28 @@
1
+ # Codex
2
+
3
+ Install the Y2 MCP server with the Codex CLI:
4
+
5
+ ```sh
6
+ export Y2_API_KEY=y2_...
7
+
8
+ codex mcp add y2 --env Y2_API_KEY=$Y2_API_KEY -- npx -y @y2-intel/mcp
9
+ ```
10
+
11
+ Equivalent `config.toml`:
12
+
13
+ ```toml
14
+ [mcp_servers.y2]
15
+ command = "npx"
16
+ args = ["-y", "@y2-intel/mcp"]
17
+ env_vars = ["Y2_API_KEY"]
18
+ startup_timeout_sec = 20
19
+ tool_timeout_sec = 120
20
+ default_tools_approval_mode = "prompt"
21
+ ```
22
+
23
+ Use the default prompt approval mode until you are comfortable with which Y2
24
+ tools are enabled for the API key.
25
+
26
+ Agent Y2 is disabled by default. To expose `y2_ask_agent`, export
27
+ `Y2_MCP_ENABLE_AGENT=1` and add it to `env_vars` alongside `Y2_API_KEY`. Use a
28
+ Y2 API key with `agent:y2` only when Agent Y2 account actions are intended.
@@ -0,0 +1,53 @@
1
+ # MCP Inspector
2
+
3
+ Build first:
4
+
5
+ ```sh
6
+ npm install
7
+ npm run build
8
+ ```
9
+
10
+ List server capabilities:
11
+
12
+ ```sh
13
+ npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
14
+ npx @modelcontextprotocol/inspector --cli node dist/index.js --method resources/list
15
+ npx @modelcontextprotocol/inspector --cli node dist/index.js --method prompts/list
16
+ ```
17
+
18
+ Agent Y2 is hidden by default. To verify the opt-in tool surface:
19
+
20
+ ```sh
21
+ npx @modelcontextprotocol/inspector --cli \
22
+ -e Y2_MCP_ENABLE_AGENT=1 \
23
+ node dist/index.js \
24
+ --method tools/list
25
+ ```
26
+
27
+ Call a no-key tool:
28
+
29
+ ```sh
30
+ npx @modelcontextprotocol/inspector --cli node dist/index.js \
31
+ --method tools/call \
32
+ --tool-name y2_get_openapi_operation \
33
+ --tool-arg operationId=listReports
34
+ ```
35
+
36
+ Read a no-key resource:
37
+
38
+ ```sh
39
+ npx @modelcontextprotocol/inspector --cli node dist/index.js \
40
+ --method resources/read \
41
+ --uri y2://quickstart
42
+ ```
43
+
44
+ Call a scoped Y2 API tool:
45
+
46
+ ```sh
47
+ npx @modelcontextprotocol/inspector --cli \
48
+ -e Y2_API_KEY=$Y2_API_KEY \
49
+ node dist/index.js \
50
+ --method tools/call \
51
+ --tool-name y2_list_reports \
52
+ --tool-arg limit=1
53
+ ```
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@y2-intel/mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for connecting AI agents to Y2",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": "Y2",
8
+ "homepage": "https://y2.dev/docs/api/mcp",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/y2-intel/mcp.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/y2-intel/mcp/issues"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "model-context-protocol",
19
+ "claude",
20
+ "codex",
21
+ "ai-agents",
22
+ "y2",
23
+ "intelligence",
24
+ "openapi"
25
+ ],
26
+ "bin": {
27
+ "y2-mcp": "dist/index.js"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "LICENSE",
33
+ "SECURITY.md",
34
+ "CHANGELOG.md",
35
+ "examples",
36
+ "server.json"
37
+ ],
38
+ "mcpName": "io.github.y2-intel/mcp",
39
+ "scripts": {
40
+ "build": "tsc -p tsconfig.json",
41
+ "dev": "tsx src/index.ts",
42
+ "inspect:all": "npm run inspect:tools && npm run inspect:resources && npm run inspect:prompts && npm run inspect:openapi && npm run inspect:no-key-error",
43
+ "inspect:no-key-error": "npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/call --tool-name y2_list_reports --tool-arg limit=1",
44
+ "inspect:openapi": "npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/call --tool-name y2_get_openapi_operation --tool-arg operationId=listReports",
45
+ "inspect:prompts": "npx @modelcontextprotocol/inspector --cli node dist/index.js --method prompts/list",
46
+ "inspect:resources": "npx @modelcontextprotocol/inspector --cli node dist/index.js --method resources/list",
47
+ "inspect:tools": "npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list",
48
+ "prepublishOnly": "npm run release:check",
49
+ "release:check": "npm run build && npm run typecheck:extras && npm test && npm pack --dry-run && npm run inspect:all",
50
+ "smoke:live": "tsx scripts/smoke-live.ts",
51
+ "test": "tsx --test test/*.test.ts",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit && npm run typecheck:extras",
53
+ "typecheck:extras": "tsc --ignoreConfig --noEmit --module NodeNext --moduleResolution NodeNext --target ES2022 --strict --skipLibCheck --types node scripts/*.ts test/*.ts"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "dependencies": {
59
+ "@modelcontextprotocol/sdk": "^1.29.0",
60
+ "yaml": "^2.9.0",
61
+ "zod": "^3.25.76"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^26.0.1",
65
+ "tsx": "^4.22.4",
66
+ "typescript": "^6.0.3"
67
+ },
68
+ "engines": {
69
+ "node": ">=20"
70
+ }
71
+ }
package/server.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.y2-intel/mcp",
4
+ "title": "Y2 MCP",
5
+ "description": "Connect MCP-compatible agents to Y2 docs, OpenAPI, reports, news, and Agent Y2.",
6
+ "version": "0.1.0",
7
+ "packages": [
8
+ {
9
+ "registryType": "npm",
10
+ "identifier": "@y2-intel/mcp",
11
+ "version": "0.1.0",
12
+ "transport": {
13
+ "type": "stdio"
14
+ }
15
+ }
16
+ ]
17
+ }