mcpsmgr 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 (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +1631 -0
  5. package/dist/index.js.map +1 -0
  6. package/docs/README_zh-CN.md +99 -0
  7. package/openspec/changes/archive/2026-03-12-fix-global-mcp-default-selection/.openspec.yaml +2 -0
  8. package/openspec/changes/archive/2026-03-12-fix-global-mcp-default-selection/design.md +41 -0
  9. package/openspec/changes/archive/2026-03-12-fix-global-mcp-default-selection/proposal.md +28 -0
  10. package/openspec/changes/archive/2026-03-12-fix-global-mcp-default-selection/specs/project-operations/spec.md +53 -0
  11. package/openspec/changes/archive/2026-03-12-fix-global-mcp-default-selection/tasks.md +9 -0
  12. package/openspec/changes/archive/2026-03-12-fix-init-server-detection/.openspec.yaml +2 -0
  13. package/openspec/changes/archive/2026-03-12-fix-init-server-detection/design.md +40 -0
  14. package/openspec/changes/archive/2026-03-12-fix-init-server-detection/proposal.md +25 -0
  15. package/openspec/changes/archive/2026-03-12-fix-init-server-detection/specs/project-operations/spec.md +25 -0
  16. package/openspec/changes/archive/2026-03-12-fix-init-server-detection/tasks.md +10 -0
  17. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/.openspec.yaml +2 -0
  18. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/design.md +32 -0
  19. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/proposal.md +25 -0
  20. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/specs/project-operations/spec.md +30 -0
  21. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/specs/server-management/spec.md +15 -0
  22. package/openspec/changes/archive/2026-03-12-graceful-exit-on-interrupt/tasks.md +17 -0
  23. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/.openspec.yaml +2 -0
  24. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/design.md +104 -0
  25. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/proposal.md +34 -0
  26. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/specs/agent-adapters/spec.md +110 -0
  27. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/specs/central-storage/spec.md +38 -0
  28. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/specs/glm-integration/spec.md +66 -0
  29. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/specs/project-operations/spec.md +76 -0
  30. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/specs/server-management/spec.md +75 -0
  31. package/openspec/changes/archive/2026-03-12-mcps-manager-cli/tasks.md +60 -0
  32. package/openspec/config.yaml +20 -0
  33. package/openspec/specs/agent-adapters/spec.md +148 -0
  34. package/openspec/specs/central-storage/spec.md +42 -0
  35. package/openspec/specs/glm-integration/spec.md +70 -0
  36. package/openspec/specs/project-operations/spec.md +138 -0
  37. package/openspec/specs/server-management/spec.md +93 -0
  38. package/package.json +33 -0
  39. package/src/__tests__/integration.test.ts +200 -0
  40. package/src/adapters/__tests__/adapters.test.ts +274 -0
  41. package/src/adapters/antigravity.ts +114 -0
  42. package/src/adapters/claude-code.ts +114 -0
  43. package/src/adapters/codex-cli.ts +135 -0
  44. package/src/adapters/env-args.ts +51 -0
  45. package/src/adapters/gemini-cli.ts +110 -0
  46. package/src/adapters/index.ts +32 -0
  47. package/src/adapters/json-file.ts +24 -0
  48. package/src/adapters/opencode.ts +114 -0
  49. package/src/commands/add.ts +68 -0
  50. package/src/commands/init.ts +136 -0
  51. package/src/commands/list.ts +77 -0
  52. package/src/commands/remove.ts +61 -0
  53. package/src/commands/server-add.ts +211 -0
  54. package/src/commands/server-list.ts +24 -0
  55. package/src/commands/server-remove.ts +12 -0
  56. package/src/commands/setup.ts +71 -0
  57. package/src/commands/sync.ts +98 -0
  58. package/src/index.ts +100 -0
  59. package/src/services/glm-client.ts +190 -0
  60. package/src/services/system-prompt.ts +61 -0
  61. package/src/services/web-reader.ts +130 -0
  62. package/src/types.ts +59 -0
  63. package/src/utils/config.ts +22 -0
  64. package/src/utils/paths.ts +11 -0
  65. package/src/utils/prompt.ts +3 -0
  66. package/src/utils/resolve-config.ts +13 -0
  67. package/src/utils/server-store.ts +56 -0
  68. package/tsconfig.json +17 -0
  69. package/tsup.config.ts +13 -0
  70. package/vitest.config.ts +8 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jtianling
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # mcpsmgr
2
+
3
+ Unified MCP (Model Context Protocol) server manager for multiple AI coding agents.
4
+
5
+ **[中文文档](./docs/README_zh-CN.md)**
6
+
7
+ ## Problem
8
+
9
+ Each AI coding agent (Claude Code, Codex CLI, Gemini CLI, OpenCode, Antigravity) uses its own config format for MCP servers. Managing the same servers across multiple agents means editing multiple config files manually, which is tedious and error-prone.
10
+
11
+ ## Solution
12
+
13
+ `mcpsmgr` provides a central repository for MCP server definitions and syncs them to all your coding agents with a single command. Define once, deploy everywhere.
14
+
15
+ ```
16
+ Central Repository Agent Configs
17
+ ┌──────────────────┐ ┌─► Claude Code (.claude.json)
18
+ │ server-a (stdio)│───┼─► Codex CLI (.codex/config.toml)
19
+ │ server-b (http) │ ├─► Gemini CLI (.gemini/settings.json)
20
+ │ server-c (stdio)│ ├─► OpenCode (.opencode.json)
21
+ └──────────────────┘ └─► Antigravity (.antigravity/config.json)
22
+ ```
23
+
24
+ ## Features
25
+
26
+ - **Central server repository** - Define MCP servers once in `~/.mcps-manager/servers/`
27
+ - **Multi-agent support** - Claude Code, Codex CLI, Gemini CLI, OpenCode, Antigravity
28
+ - **AI-assisted setup** - Provide a URL or GitHub repo, and GLM-5 analyzes the documentation to generate the config automatically
29
+ - **Per-agent overrides** - Customize server config for specific agents when needed
30
+ - **Project-level init** - Deploy selected servers to detected agents in any project
31
+ - **Sync** - Push central repository updates to all agent configs
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ # From source
37
+ pnpm install
38
+ pnpm build
39
+ npm link
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ```bash
45
+ # 1. Initial setup (configure GLM API key)
46
+ mcpsmgr setup
47
+
48
+ # 2. Add a server to central repository
49
+ mcpsmgr server add https://github.com/anthropics/some-mcp-server
50
+
51
+ # Or add manually
52
+ mcpsmgr server add
53
+
54
+ # 3. Initialize a project (deploy servers to agents)
55
+ cd your-project
56
+ mcpsmgr init
57
+
58
+ # 4. Add a specific server to the current project
59
+ mcpsmgr add my-server
60
+
61
+ # 5. Sync central changes to project agents
62
+ mcpsmgr sync
63
+ ```
64
+
65
+ ## Commands
66
+
67
+ | Command | Description |
68
+ |---|---|
69
+ | `mcpsmgr setup` | Initialize global configuration |
70
+ | `mcpsmgr server add [source]` | Add a server to central repository (URL, GitHub owner/repo, or manual) |
71
+ | `mcpsmgr server remove <name>` | Remove a server from central repository |
72
+ | `mcpsmgr server list` | List all servers in central repository |
73
+ | `mcpsmgr init` | Deploy servers to agents in current project |
74
+ | `mcpsmgr add <server>` | Add a central server to current project |
75
+ | `mcpsmgr remove <server>` | Remove a server from current project |
76
+ | `mcpsmgr sync` | Sync central repository changes to project |
77
+ | `mcpsmgr list` | List MCP servers across all agents in current project |
78
+
79
+ ## Supported Agents
80
+
81
+ | Agent | Config Location | Format |
82
+ |---|---|---|
83
+ | Claude Code | `.claude.json` (project) | JSON |
84
+ | Codex CLI | `.codex/config.toml` (project) | TOML |
85
+ | Gemini CLI | `.gemini/settings.json` (global) | JSON |
86
+ | OpenCode | `.opencode.json` (project) | JSON |
87
+ | Antigravity | `.antigravity/config.json` (project) | JSON |
88
+
89
+ ## How It Works
90
+
91
+ 1. **Central Repository** (`~/.mcps-manager/servers/`) stores server definitions as JSON files, each containing the server name, source, default config, and per-agent overrides.
92
+
93
+ 2. **Agent Adapters** understand each agent's config format. When deploying, `mcpsmgr` resolves the final config (default + overrides) and writes it in the agent's native format.
94
+
95
+ 3. **AI Analysis** (optional) uses GLM-5 to read MCP server documentation and auto-generate the server definition, including command, args, env vars, and transport type.
96
+
97
+ ## License
98
+
99
+ MIT
@@ -0,0 +1,2 @@
1
+
2
+ export { }