@manhq/localmcp 1.0.0 → 1.0.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.
- package/README.md +177 -66
- package/README.vi.md +176 -65
- package/dist/api/openapi.d.ts +21 -0
- package/dist/api/openapi.d.ts.map +1 -0
- package/dist/api/openapi.js +74 -0
- package/dist/api/openapi.js.map +1 -0
- package/dist/api/playground.d.ts +2 -0
- package/dist/api/playground.d.ts.map +1 -0
- package/dist/api/playground.js +24 -0
- package/dist/api/playground.js.map +1 -0
- package/dist/api/registry.d.ts +19 -0
- package/dist/api/registry.d.ts.map +1 -0
- package/dist/api/registry.js +20 -0
- package/dist/api/registry.js.map +1 -0
- package/dist/api/rest.d.ts +3 -0
- package/dist/api/rest.d.ts.map +1 -0
- package/dist/api/rest.js +84 -0
- package/dist/api/rest.js.map +1 -0
- package/dist/api/server-with-registry.d.ts +8 -0
- package/dist/api/server-with-registry.d.ts.map +1 -0
- package/dist/api/server-with-registry.js +43 -0
- package/dist/api/server-with-registry.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +82 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +125 -48
- package/dist/index.js.map +1 -1
- package/dist/services/atlassian/index.d.ts +1 -1
- package/dist/services/atlassian/index.d.ts.map +1 -1
- package/dist/services/atlassian/index.js +3 -3
- package/dist/services/atlassian/index.js.map +1 -1
- package/dist/services/atlassian/tools/confluence.d.ts +1 -1
- package/dist/services/atlassian/tools/confluence.d.ts.map +1 -1
- package/dist/services/atlassian/tools/confluence.js +14 -13
- package/dist/services/atlassian/tools/confluence.js.map +1 -1
- package/dist/services/atlassian/tools/jira.d.ts +1 -1
- package/dist/services/atlassian/tools/jira.d.ts.map +1 -1
- package/dist/services/atlassian/tools/jira.js +16 -15
- package/dist/services/atlassian/tools/jira.js.map +1 -1
- package/dist/services/figma/index.d.ts +1 -1
- package/dist/services/figma/index.d.ts.map +1 -1
- package/dist/services/figma/index.js +6 -6
- package/dist/services/figma/index.js.map +1 -1
- package/dist/services/figma/tools/comments.d.ts +1 -1
- package/dist/services/figma/tools/comments.d.ts.map +1 -1
- package/dist/services/figma/tools/comments.js +4 -3
- package/dist/services/figma/tools/comments.js.map +1 -1
- package/dist/services/figma/tools/components.d.ts +1 -1
- package/dist/services/figma/tools/components.d.ts.map +1 -1
- package/dist/services/figma/tools/components.js +7 -6
- package/dist/services/figma/tools/components.js.map +1 -1
- package/dist/services/figma/tools/files.d.ts +1 -1
- package/dist/services/figma/tools/files.d.ts.map +1 -1
- package/dist/services/figma/tools/files.js +4 -3
- package/dist/services/figma/tools/files.js.map +1 -1
- package/dist/services/figma/tools/images.d.ts +1 -1
- package/dist/services/figma/tools/images.d.ts.map +1 -1
- package/dist/services/figma/tools/images.js +4 -3
- package/dist/services/figma/tools/images.js.map +1 -1
- package/dist/services/figma/tools/variables.d.ts +1 -1
- package/dist/services/figma/tools/variables.d.ts.map +1 -1
- package/dist/services/figma/tools/variables.js +4 -3
- package/dist/services/figma/tools/variables.js.map +1 -1
- package/dist/services/google-chat/index.d.ts +1 -1
- package/dist/services/google-chat/index.d.ts.map +1 -1
- package/dist/services/google-chat/index.js +2 -2
- package/dist/services/google-chat/index.js.map +1 -1
- package/dist/services/google-chat/tools/messages.d.ts +1 -1
- package/dist/services/google-chat/tools/messages.d.ts.map +1 -1
- package/dist/services/google-chat/tools/messages.js +6 -5
- package/dist/services/google-chat/tools/messages.js.map +1 -1
- package/docs/atlassian.md +145 -6
- package/docs/figma.md +145 -6
- package/docs/google-chat.md +145 -6
- package/docs/vi/atlassian.md +145 -6
- package/docs/vi/figma.md +145 -6
- package/docs/vi/google-chat.md +145 -6
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -12,62 +12,35 @@ Self-hosted MCP server integrating Figma, Jira, and Google Chat for AI agents.
|
|
|
12
12
|
## Install & Run
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
cp .env.example .env
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Fill credentials in `.env` (see each service doc below), then:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Run in dev mode with auto reload
|
|
26
|
-
npm run dev
|
|
27
|
-
|
|
28
|
-
# Build & run production
|
|
29
|
-
npm run build
|
|
30
|
-
npm start
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The server runs at `http://localhost:47001` by default.
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Open MCP Inspector while the server is running
|
|
37
|
-
npm run inspect
|
|
15
|
+
npm install -g @manhq/localmcp
|
|
16
|
+
localmcp init # create ~/localmcp/settings.json
|
|
17
|
+
localmcp config # fill in credentials
|
|
18
|
+
localmcp # start the server
|
|
38
19
|
```
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
If you do not want to open the project every time, register a global command while developing locally:
|
|
21
|
+
Or clone and run locally:
|
|
43
22
|
|
|
44
23
|
```bash
|
|
24
|
+
npm install
|
|
45
25
|
npm run build
|
|
46
|
-
npm link
|
|
26
|
+
npm link # makes `localmcp` available globally
|
|
47
27
|
localmcp
|
|
48
28
|
```
|
|
49
29
|
|
|
50
|
-
|
|
30
|
+
Default settings path: `~/localmcp/settings.json`
|
|
51
31
|
|
|
52
|
-
|
|
32
|
+
Environment variables take precedence over the settings file:
|
|
53
33
|
|
|
54
34
|
```bash
|
|
55
|
-
|
|
56
|
-
localmcp init
|
|
57
|
-
localmcp config
|
|
58
|
-
localmcp
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Default settings path:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
~/localmcp/settings.json
|
|
35
|
+
PORT=47002 localmcp
|
|
65
36
|
```
|
|
66
37
|
|
|
67
|
-
|
|
38
|
+
## Commands
|
|
68
39
|
|
|
69
40
|
```bash
|
|
70
|
-
localmcp # Run the MCP server
|
|
41
|
+
localmcp # Run the MCP server (HTTP)
|
|
42
|
+
localmcp stdio # Run as stdio MCP server (combined)
|
|
43
|
+
localmcp stdio <service> # Run as stdio MCP server for one service
|
|
71
44
|
localmcp init # Create settings for the first time
|
|
72
45
|
localmcp list # List services and missing variables
|
|
73
46
|
localmcp config # Open settings with vim or $EDITOR
|
|
@@ -75,52 +48,104 @@ localmcp config figma # Configure Figma with inline prompts
|
|
|
75
48
|
localmcp config figma token=figd_xxx
|
|
76
49
|
localmcp register # Select AI agent, then localmcp or a service
|
|
77
50
|
localmcp register codex --service figma
|
|
78
|
-
localmcp inspect # Open MCP Inspector
|
|
51
|
+
localmcp inspect # Open MCP Inspector (HTTP, server must be running)
|
|
52
|
+
localmcp inspect --stdio # Open MCP Inspector using stdio transport
|
|
53
|
+
localmcp playground # Open REST API playground in browser
|
|
79
54
|
localmcp --version # Show version
|
|
80
55
|
```
|
|
81
56
|
|
|
82
|
-
|
|
57
|
+
## Endpoints
|
|
83
58
|
|
|
84
|
-
|
|
85
|
-
PORT=47002 localmcp
|
|
86
|
-
```
|
|
59
|
+
When the server is running (`localmcp`):
|
|
87
60
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
| Transport | URL |
|
|
62
|
+
|-----------|-----|
|
|
63
|
+
| Streamable HTTP (combined) | `http://localhost:47001/mcp` |
|
|
64
|
+
| Streamable HTTP (per service) | `http://localhost:47001/mcp/<service>` |
|
|
65
|
+
| Legacy SSE (combined) | `http://localhost:47001/sse` |
|
|
66
|
+
| Legacy SSE (per service) | `http://localhost:47001/sse/<service>` |
|
|
67
|
+
| REST API | `http://localhost:47001/api` |
|
|
68
|
+
| REST Playground | `http://localhost:47001/playground` |
|
|
69
|
+
| Health check | `http://localhost:47001/health` |
|
|
93
70
|
|
|
94
71
|
## Register with AI Agents
|
|
95
72
|
|
|
96
|
-
|
|
73
|
+
> **Tip:** Run `localmcp register` to register automatically, or use `localmcp` startup log to copy stdio commands.
|
|
74
|
+
|
|
75
|
+
Each agent supports two transport modes — choose the one that fits your setup:
|
|
76
|
+
|
|
77
|
+
- **HTTP** — requires the server to be running (`localmcp`). Faster, shared across agents.
|
|
78
|
+
- **stdio** — agent spawns the process on demand. No server needed, but each agent gets its own process.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Claude Code
|
|
83
|
+
|
|
84
|
+
**HTTP** — `.claude/settings.local.json`
|
|
97
85
|
```json
|
|
98
86
|
{
|
|
99
87
|
"mcpServers": {
|
|
100
88
|
"localmcp": {
|
|
89
|
+
"type": "http",
|
|
101
90
|
"url": "http://localhost:47001/mcp"
|
|
102
91
|
}
|
|
103
92
|
}
|
|
104
93
|
}
|
|
105
94
|
```
|
|
106
95
|
|
|
96
|
+
**stdio** — `.claude/settings.local.json`
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"localmcp": {
|
|
101
|
+
"type": "stdio",
|
|
102
|
+
"command": "localmcp",
|
|
103
|
+
"args": ["stdio"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
107
109
|
Or register from the command line:
|
|
108
110
|
```bash
|
|
111
|
+
# HTTP
|
|
109
112
|
claude mcp add --transport http localmcp http://localhost:47001/mcp
|
|
113
|
+
|
|
114
|
+
# stdio
|
|
115
|
+
claude mcp add localmcp localmcp stdio
|
|
110
116
|
```
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### Codex
|
|
121
|
+
|
|
122
|
+
**HTTP** — `~/.codex/config.toml`
|
|
113
123
|
```toml
|
|
114
124
|
[mcp_servers.localmcp]
|
|
115
125
|
url = "http://localhost:47001/mcp"
|
|
116
126
|
```
|
|
117
127
|
|
|
128
|
+
**stdio** — `~/.codex/config.toml`
|
|
129
|
+
```toml
|
|
130
|
+
[mcp_servers.localmcp]
|
|
131
|
+
command = "localmcp"
|
|
132
|
+
args = ["stdio"]
|
|
133
|
+
```
|
|
134
|
+
|
|
118
135
|
Or register from the command line:
|
|
119
136
|
```bash
|
|
137
|
+
# HTTP
|
|
120
138
|
codex mcp add localmcp --url http://localhost:47001/mcp
|
|
139
|
+
|
|
140
|
+
# stdio
|
|
141
|
+
codex mcp add localmcp localmcp stdio
|
|
121
142
|
```
|
|
122
143
|
|
|
123
|
-
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### GitHub Copilot / VS Code
|
|
147
|
+
|
|
148
|
+
**HTTP** — `.vscode/mcp.json`
|
|
124
149
|
```json
|
|
125
150
|
{
|
|
126
151
|
"servers": {
|
|
@@ -132,7 +157,24 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
132
157
|
}
|
|
133
158
|
```
|
|
134
159
|
|
|
135
|
-
**
|
|
160
|
+
**stdio** — `.vscode/mcp.json`
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"servers": {
|
|
164
|
+
"localmcp": {
|
|
165
|
+
"type": "stdio",
|
|
166
|
+
"command": "localmcp",
|
|
167
|
+
"args": ["stdio"]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### Cursor
|
|
176
|
+
|
|
177
|
+
**HTTP** — `.cursor/mcp.json`
|
|
136
178
|
```json
|
|
137
179
|
{
|
|
138
180
|
"mcpServers": {
|
|
@@ -143,18 +185,23 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
143
185
|
}
|
|
144
186
|
```
|
|
145
187
|
|
|
146
|
-
**
|
|
188
|
+
**stdio** — `.cursor/mcp.json`
|
|
147
189
|
```json
|
|
148
190
|
{
|
|
149
191
|
"mcpServers": {
|
|
150
192
|
"localmcp": {
|
|
151
|
-
"
|
|
193
|
+
"command": "localmcp",
|
|
194
|
+
"args": ["stdio"]
|
|
152
195
|
}
|
|
153
196
|
}
|
|
154
197
|
}
|
|
155
198
|
```
|
|
156
199
|
|
|
157
|
-
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### Windsurf
|
|
203
|
+
|
|
204
|
+
**HTTP** — `~/.codeium/windsurf/mcp_config.json`
|
|
158
205
|
```json
|
|
159
206
|
{
|
|
160
207
|
"mcpServers": {
|
|
@@ -165,27 +212,91 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
165
212
|
}
|
|
166
213
|
```
|
|
167
214
|
|
|
168
|
-
|
|
215
|
+
**stdio** — `~/.codeium/windsurf/mcp_config.json`
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"mcpServers": {
|
|
219
|
+
"localmcp": {
|
|
220
|
+
"command": "localmcp",
|
|
221
|
+
"args": ["stdio"]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### Antigravity
|
|
230
|
+
|
|
231
|
+
**HTTP** — `~/.gemini/config/mcp_config.json`
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"mcpServers": {
|
|
235
|
+
"localmcp": {
|
|
236
|
+
"serverUrl": "http://localhost:47001/mcp"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
169
241
|
|
|
242
|
+
**stdio** — `~/.gemini/config/mcp_config.json`
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"mcpServers": {
|
|
246
|
+
"localmcp": {
|
|
247
|
+
"command": "localmcp",
|
|
248
|
+
"args": ["stdio"]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
170
252
|
```
|
|
171
|
-
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## REST API
|
|
257
|
+
|
|
258
|
+
The REST API lets you call any tool over plain HTTP — useful for scripts, automation, and the playground.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# List services
|
|
262
|
+
GET http://localhost:47001/api
|
|
263
|
+
|
|
264
|
+
# List tools for a service
|
|
265
|
+
GET http://localhost:47001/api/figma
|
|
266
|
+
GET http://localhost:47001/api/atlassian
|
|
267
|
+
|
|
268
|
+
# Call a tool
|
|
269
|
+
POST http://localhost:47001/api/figma/whoami
|
|
270
|
+
POST http://localhost:47001/api/atlassian/getJiraIssue
|
|
271
|
+
Content-Type: application/json
|
|
272
|
+
|
|
273
|
+
{"issueIdOrKey": "PROJ-123"}
|
|
274
|
+
|
|
275
|
+
# OpenAPI spec
|
|
276
|
+
GET http://localhost:47001/api/openapi.json
|
|
277
|
+
|
|
278
|
+
# Interactive playground
|
|
279
|
+
GET http://localhost:47001/playground
|
|
172
280
|
```
|
|
173
281
|
|
|
174
|
-
|
|
282
|
+
Or open the playground with:
|
|
283
|
+
```bash
|
|
284
|
+
localmcp playground
|
|
285
|
+
```
|
|
175
286
|
|
|
176
287
|
---
|
|
177
288
|
|
|
178
289
|
## Services
|
|
179
290
|
|
|
180
|
-
| Service |
|
|
181
|
-
|
|
291
|
+
| Service | HTTP endpoint | Docs |
|
|
292
|
+
|---------|---------------|------|
|
|
182
293
|
| Figma | `/mcp/figma` | [EN](docs/figma.md) / [VI](docs/vi/figma.md) |
|
|
183
294
|
| Atlassian | `/mcp/atlassian` | [EN](docs/atlassian.md) / [VI](docs/vi/atlassian.md) |
|
|
184
295
|
| Google Chat | `/mcp/google-chat` | [EN](docs/google-chat.md) / [VI](docs/vi/google-chat.md) |
|
|
185
296
|
|
|
186
|
-
The `/mcp` endpoint is combined
|
|
297
|
+
The `/mcp` endpoint is combined — it exposes every active service through one server, with tool names prefixed by service (`figma_`, `atlassian_`, `gchat_`).
|
|
187
298
|
|
|
188
|
-
Each service is enabled only when all required environment variables are present.
|
|
299
|
+
Each service is enabled only when all required environment variables are present.
|
|
189
300
|
|
|
190
301
|
---
|
|
191
302
|
|
|
@@ -211,7 +322,7 @@ import { registerXxxTools } from "./services/xxx/index.js";
|
|
|
211
322
|
|
|
212
323
|
const SERVICE_REGISTRY = {
|
|
213
324
|
// ...existing services...
|
|
214
|
-
xxx: { register: registerXxxTools, enabled: !!env.xxx },
|
|
325
|
+
xxx: { register: registerXxxTools, combinedPrefix: "xxx", enabled: !!env.xxx },
|
|
215
326
|
};
|
|
216
327
|
```
|
|
217
328
|
|
package/README.vi.md
CHANGED
|
@@ -12,62 +12,35 @@ MCP server tự host, tích hợp Figma, Jira và Google Chat cho các AI agent.
|
|
|
12
12
|
## Cài đặt & chạy
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
cp .env.example .env
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Điền credentials vào `.env` (xem tài liệu từng service bên dưới), sau đó:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Chạy ở chế độ dev (tự reload khi sửa code)
|
|
26
|
-
npm run dev
|
|
27
|
-
|
|
28
|
-
# Build & chạy production
|
|
29
|
-
npm run build
|
|
30
|
-
npm start
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Server mặc định chạy tại `http://localhost:47001`.
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Mở MCP Inspector (chạy song song với server)
|
|
37
|
-
npm run inspect
|
|
15
|
+
npm install -g @manhq/localmcp
|
|
16
|
+
localmcp init # tạo ~/localmcp/settings.json
|
|
17
|
+
localmcp config # điền credentials
|
|
18
|
+
localmcp # khởi động server
|
|
38
19
|
```
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Nếu không muốn mở project mỗi lần chạy, có thể đăng ký command global khi đang phát triển local:
|
|
21
|
+
Hoặc clone về và chạy local:
|
|
43
22
|
|
|
44
23
|
```bash
|
|
24
|
+
npm install
|
|
45
25
|
npm run build
|
|
46
|
-
npm link
|
|
26
|
+
npm link # đăng ký lệnh `localmcp` global
|
|
47
27
|
localmcp
|
|
48
28
|
```
|
|
49
29
|
|
|
50
|
-
|
|
30
|
+
Settings mặc định nằm ở: `~/localmcp/settings.json`
|
|
51
31
|
|
|
52
|
-
|
|
32
|
+
Biến môi trường được ưu tiên hơn settings file:
|
|
53
33
|
|
|
54
34
|
```bash
|
|
55
|
-
|
|
56
|
-
localmcp init
|
|
57
|
-
localmcp config
|
|
58
|
-
localmcp
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Settings mặc định nằm ở:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
~/localmcp/settings.json
|
|
35
|
+
PORT=47002 localmcp
|
|
65
36
|
```
|
|
66
37
|
|
|
67
|
-
Các
|
|
38
|
+
## Các lệnh
|
|
68
39
|
|
|
69
40
|
```bash
|
|
70
|
-
localmcp # Chạy MCP server
|
|
41
|
+
localmcp # Chạy MCP server (HTTP)
|
|
42
|
+
localmcp stdio # Chạy dưới dạng stdio MCP server (tất cả services)
|
|
43
|
+
localmcp stdio <service> # Chạy stdio cho một service cụ thể
|
|
71
44
|
localmcp init # Tạo settings lần đầu
|
|
72
45
|
localmcp list # Liệt kê services và biến còn thiếu
|
|
73
46
|
localmcp config # Mở settings bằng vim hoặc $EDITOR
|
|
@@ -75,52 +48,104 @@ localmcp config figma # Config riêng service Figma bằng prompt inl
|
|
|
75
48
|
localmcp config figma token=figd_xxx
|
|
76
49
|
localmcp register # Chọn AI agent, sau đó chọn localmcp hoặc service
|
|
77
50
|
localmcp register codex --service figma
|
|
78
|
-
localmcp inspect # Mở MCP Inspector
|
|
51
|
+
localmcp inspect # Mở MCP Inspector (HTTP, cần server đang chạy)
|
|
52
|
+
localmcp inspect --stdio # Mở MCP Inspector dùng stdio transport
|
|
53
|
+
localmcp playground # Mở REST API playground trên trình duyệt
|
|
79
54
|
localmcp --version # Xem phiên bản
|
|
80
55
|
```
|
|
81
56
|
|
|
82
|
-
|
|
57
|
+
## Endpoints
|
|
83
58
|
|
|
84
|
-
|
|
85
|
-
PORT=47002 localmcp
|
|
86
|
-
```
|
|
59
|
+
Khi server đang chạy (`localmcp`):
|
|
87
60
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
| Transport | URL |
|
|
62
|
+
|-----------|-----|
|
|
63
|
+
| Streamable HTTP (tất cả) | `http://localhost:47001/mcp` |
|
|
64
|
+
| Streamable HTTP (theo service) | `http://localhost:47001/mcp/<service>` |
|
|
65
|
+
| Legacy SSE (tất cả) | `http://localhost:47001/sse` |
|
|
66
|
+
| Legacy SSE (theo service) | `http://localhost:47001/sse/<service>` |
|
|
67
|
+
| REST API | `http://localhost:47001/api` |
|
|
68
|
+
| REST Playground | `http://localhost:47001/playground` |
|
|
69
|
+
| Health check | `http://localhost:47001/health` |
|
|
93
70
|
|
|
94
71
|
## Đăng ký với AI Agents
|
|
95
72
|
|
|
96
|
-
|
|
73
|
+
> **Tip:** Chạy `localmcp register` để đăng ký tự động, hoặc copy lệnh stdio từ log khi khởi động `localmcp`.
|
|
74
|
+
|
|
75
|
+
Mỗi agent hỗ trợ hai chế độ transport — chọn cái phù hợp với setup của bạn:
|
|
76
|
+
|
|
77
|
+
- **HTTP** — cần server đang chạy (`localmcp`). Nhanh hơn, dùng chung giữa các agent.
|
|
78
|
+
- **stdio** — agent tự spawn process khi cần. Không cần server chạy sẵn, nhưng mỗi agent dùng process riêng.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Claude Code
|
|
83
|
+
|
|
84
|
+
**HTTP** — `.claude/settings.local.json`
|
|
97
85
|
```json
|
|
98
86
|
{
|
|
99
87
|
"mcpServers": {
|
|
100
88
|
"localmcp": {
|
|
89
|
+
"type": "http",
|
|
101
90
|
"url": "http://localhost:47001/mcp"
|
|
102
91
|
}
|
|
103
92
|
}
|
|
104
93
|
}
|
|
105
94
|
```
|
|
106
95
|
|
|
96
|
+
**stdio** — `.claude/settings.local.json`
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"localmcp": {
|
|
101
|
+
"type": "stdio",
|
|
102
|
+
"command": "localmcp",
|
|
103
|
+
"args": ["stdio"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
107
109
|
Hoặc đăng ký bằng command line:
|
|
108
110
|
```bash
|
|
111
|
+
# HTTP
|
|
109
112
|
claude mcp add --transport http localmcp http://localhost:47001/mcp
|
|
113
|
+
|
|
114
|
+
# stdio
|
|
115
|
+
claude mcp add localmcp localmcp stdio
|
|
110
116
|
```
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### Codex
|
|
121
|
+
|
|
122
|
+
**HTTP** — `~/.codex/config.toml`
|
|
113
123
|
```toml
|
|
114
124
|
[mcp_servers.localmcp]
|
|
115
125
|
url = "http://localhost:47001/mcp"
|
|
116
126
|
```
|
|
117
127
|
|
|
128
|
+
**stdio** — `~/.codex/config.toml`
|
|
129
|
+
```toml
|
|
130
|
+
[mcp_servers.localmcp]
|
|
131
|
+
command = "localmcp"
|
|
132
|
+
args = ["stdio"]
|
|
133
|
+
```
|
|
134
|
+
|
|
118
135
|
Hoặc đăng ký bằng command line:
|
|
119
136
|
```bash
|
|
137
|
+
# HTTP
|
|
120
138
|
codex mcp add localmcp --url http://localhost:47001/mcp
|
|
139
|
+
|
|
140
|
+
# stdio
|
|
141
|
+
codex mcp add localmcp localmcp stdio
|
|
121
142
|
```
|
|
122
143
|
|
|
123
|
-
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### GitHub Copilot / VS Code
|
|
147
|
+
|
|
148
|
+
**HTTP** — `.vscode/mcp.json`
|
|
124
149
|
```json
|
|
125
150
|
{
|
|
126
151
|
"servers": {
|
|
@@ -132,7 +157,24 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
132
157
|
}
|
|
133
158
|
```
|
|
134
159
|
|
|
135
|
-
**
|
|
160
|
+
**stdio** — `.vscode/mcp.json`
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"servers": {
|
|
164
|
+
"localmcp": {
|
|
165
|
+
"type": "stdio",
|
|
166
|
+
"command": "localmcp",
|
|
167
|
+
"args": ["stdio"]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### Cursor
|
|
176
|
+
|
|
177
|
+
**HTTP** — `.cursor/mcp.json`
|
|
136
178
|
```json
|
|
137
179
|
{
|
|
138
180
|
"mcpServers": {
|
|
@@ -143,18 +185,23 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
143
185
|
}
|
|
144
186
|
```
|
|
145
187
|
|
|
146
|
-
**
|
|
188
|
+
**stdio** — `.cursor/mcp.json`
|
|
147
189
|
```json
|
|
148
190
|
{
|
|
149
191
|
"mcpServers": {
|
|
150
192
|
"localmcp": {
|
|
151
|
-
"
|
|
193
|
+
"command": "localmcp",
|
|
194
|
+
"args": ["stdio"]
|
|
152
195
|
}
|
|
153
196
|
}
|
|
154
197
|
}
|
|
155
198
|
```
|
|
156
199
|
|
|
157
|
-
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### Windsurf
|
|
203
|
+
|
|
204
|
+
**HTTP** — `~/.codeium/windsurf/mcp_config.json`
|
|
158
205
|
```json
|
|
159
206
|
{
|
|
160
207
|
"mcpServers": {
|
|
@@ -165,25 +212,89 @@ codex mcp add localmcp --url http://localhost:47001/mcp
|
|
|
165
212
|
}
|
|
166
213
|
```
|
|
167
214
|
|
|
168
|
-
|
|
215
|
+
**stdio** — `~/.codeium/windsurf/mcp_config.json`
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"mcpServers": {
|
|
219
|
+
"localmcp": {
|
|
220
|
+
"command": "localmcp",
|
|
221
|
+
"args": ["stdio"]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### Antigravity
|
|
230
|
+
|
|
231
|
+
**HTTP** — `~/.gemini/config/mcp_config.json`
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"mcpServers": {
|
|
235
|
+
"localmcp": {
|
|
236
|
+
"serverUrl": "http://localhost:47001/mcp"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
169
241
|
|
|
242
|
+
**stdio** — `~/.gemini/config/mcp_config.json`
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"mcpServers": {
|
|
246
|
+
"localmcp": {
|
|
247
|
+
"command": "localmcp",
|
|
248
|
+
"args": ["stdio"]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
170
252
|
```
|
|
171
|
-
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## REST API
|
|
257
|
+
|
|
258
|
+
REST API cho phép gọi bất kỳ tool nào qua HTTP thông thường — tiện cho script, automation và playground.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Liệt kê services
|
|
262
|
+
GET http://localhost:47001/api
|
|
263
|
+
|
|
264
|
+
# Liệt kê tools của một service
|
|
265
|
+
GET http://localhost:47001/api/figma
|
|
266
|
+
GET http://localhost:47001/api/atlassian
|
|
267
|
+
|
|
268
|
+
# Gọi một tool
|
|
269
|
+
POST http://localhost:47001/api/figma/whoami
|
|
270
|
+
POST http://localhost:47001/api/atlassian/getJiraIssue
|
|
271
|
+
Content-Type: application/json
|
|
272
|
+
|
|
273
|
+
{"issueIdOrKey": "PROJ-123"}
|
|
274
|
+
|
|
275
|
+
# OpenAPI spec
|
|
276
|
+
GET http://localhost:47001/api/openapi.json
|
|
277
|
+
|
|
278
|
+
# Interactive playground
|
|
279
|
+
GET http://localhost:47001/playground
|
|
172
280
|
```
|
|
173
281
|
|
|
174
|
-
|
|
282
|
+
Hoặc mở playground bằng lệnh:
|
|
283
|
+
```bash
|
|
284
|
+
localmcp playground
|
|
285
|
+
```
|
|
175
286
|
|
|
176
287
|
---
|
|
177
288
|
|
|
178
289
|
## Danh sách services
|
|
179
290
|
|
|
180
|
-
| Service |
|
|
291
|
+
| Service | HTTP endpoint | Tài liệu |
|
|
181
292
|
|---------|---------------|----------|
|
|
182
293
|
| Figma | `/mcp/figma` | [EN](docs/figma.md) / [VI](docs/vi/figma.md) |
|
|
183
294
|
| Atlassian | `/mcp/atlassian` | [EN](docs/atlassian.md) / [VI](docs/vi/atlassian.md) |
|
|
184
295
|
| Google Chat | `/mcp/google-chat` | [EN](docs/google-chat.md) / [VI](docs/vi/google-chat.md) |
|
|
185
296
|
|
|
186
|
-
Endpoint `/mcp` là combined — gộp tất cả services đang active vào một server.
|
|
297
|
+
Endpoint `/mcp` là combined — gộp tất cả services đang active vào một server, tên tool có prefix theo service (`figma_`, `atlassian_`, `gchat_`).
|
|
187
298
|
|
|
188
299
|
Mỗi service chỉ được bật khi đủ biến môi trường. Xem tài liệu từng service để biết biến nào cần thiết.
|
|
189
300
|
|
|
@@ -211,7 +322,7 @@ import { registerXxxTools } from "./services/xxx/index.js";
|
|
|
211
322
|
|
|
212
323
|
const SERVICE_REGISTRY = {
|
|
213
324
|
// ...services hiện có...
|
|
214
|
-
xxx: { register: registerXxxTools, enabled: !!env.xxx },
|
|
325
|
+
xxx: { register: registerXxxTools, combinedPrefix: "xxx", enabled: !!env.xxx },
|
|
215
326
|
};
|
|
216
327
|
```
|
|
217
328
|
|
|
@@ -236,4 +347,4 @@ XXX_API_KEY=
|
|
|
236
347
|
|
|
237
348
|
### 4. Viết tài liệu
|
|
238
349
|
|
|
239
|
-
Tạo `docs/<tên-service>.md`
|
|
350
|
+
Tạo `docs/<tên-service>.md` và `docs/vi/<tên-service>.md`, sau đó thêm dòng vào bảng **Danh sách services** ở cả hai README.
|