@foundation0/api 1.1.12 → 1.1.13
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 +128 -128
- package/agents.ts +918 -918
- package/git.ts +20 -20
- package/libs/curl.ts +770 -770
- package/mcp/cli.mjs +37 -37
- package/mcp/cli.ts +87 -87
- package/mcp/client.ts +565 -565
- package/mcp/index.ts +15 -15
- package/mcp/server.ts +2991 -2991
- package/net.ts +170 -170
- package/package.json +13 -9
- package/projects.ts +4250 -4340
- package/taskgraph-parser.ts +217 -217
- package/libs/curl.test.ts +0 -130
- package/mcp/AGENTS.md +0 -130
- package/mcp/client.test.ts +0 -142
- package/mcp/manual.md +0 -179
- package/mcp/server.test.ts +0 -967
package/README.md
CHANGED
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
# example-org MCP Server
|
|
2
|
-
|
|
3
|
-
Install and register the example-org MCP server with the MCP-enabled agent/tooling you use.
|
|
4
|
-
|
|
5
|
-
## 1) Install
|
|
6
|
-
|
|
7
|
-
Option A: install from npm (recommended for agent machines)
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm add -g @foundation0/api
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Option B: run from npm without installing
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pnpm dlx @foundation0/api f0-mcp --help
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
The runnable entrypoint is `f0-mcp` (available from `bin` when installed globally).
|
|
20
|
-
|
|
21
|
-
## 2) Environment
|
|
22
|
-
|
|
23
|
-
The server supports:
|
|
24
|
-
|
|
25
|
-
- `GITEA_HOST` (recommended, required by git-backed tools)
|
|
26
|
-
- `FALLBACK_GITEA_HOST` (fallback host variable)
|
|
27
|
-
- `GITEA_TOKEN` (for authenticated actions)
|
|
28
|
-
- `MCP_TOOLS_PREFIX` (or `--tools-prefix`) to namespace tools in clients
|
|
29
|
-
- `MCP_ALLOWED_ROOT_ENDPOINTS` (or `--allowed-root-endpoints`) to whitelist API root endpoints
|
|
30
|
-
- `MCP_DISABLE_WRITE` (or `--disable-write`) to expose read-only tools only
|
|
31
|
-
- `MCP_ENABLE_ISSUES` (or `--enable-issues`) to allow issue endpoints when write mode is disabled
|
|
32
|
-
- `MCP_ADMIN` (or `--admin`) to expose admin-only destructive endpoints
|
|
33
|
-
|
|
34
|
-
Useful defaults:
|
|
35
|
-
|
|
36
|
-
- default server name: `f0-mcp`
|
|
37
|
-
- default server version: `1.0.0`
|
|
38
|
-
|
|
39
|
-
## 3) Registering with different MCP agents
|
|
40
|
-
|
|
41
|
-
### A) `.codex/config.toml`
|
|
42
|
-
|
|
43
|
-
```toml
|
|
44
|
-
[mcp_servers.example]
|
|
45
|
-
command = "bun"
|
|
46
|
-
args = ["x", "@foundation0/api", "f0-mcp"]
|
|
47
|
-
enabled = true
|
|
48
|
-
startup_timeout_ms = 20_000
|
|
49
|
-
env = {
|
|
50
|
-
GITEA_HOST = "https://gitea.example.com",
|
|
51
|
-
GITEA_TOKEN = "your-token",
|
|
52
|
-
MCP_TOOLS_PREFIX = "example"
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
If you installed globally with `pnpm add -g`, swap `command` to:
|
|
57
|
-
|
|
58
|
-
```toml
|
|
59
|
-
command = "f0-mcp"
|
|
60
|
-
args = []
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### B) Claude Desktop (`claude_desktop_config.json`)
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"mcpServers": {
|
|
68
|
-
"example": {
|
|
69
|
-
"command": "bun",
|
|
70
|
-
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "example"],
|
|
71
|
-
"env": {
|
|
72
|
-
"GITEA_HOST": "https://gitea.example.com",
|
|
73
|
-
"GITEA_TOKEN": "your-token"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Use `command: "f0-mcp"` instead of `bun run ...` if you prefer the global install.
|
|
81
|
-
|
|
82
|
-
### C) Cursor
|
|
83
|
-
|
|
84
|
-
Use the same command/args/env block in your MCP server configuration area:
|
|
85
|
-
|
|
86
|
-
```json
|
|
87
|
-
{
|
|
88
|
-
"command": "bun",
|
|
89
|
-
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "example"],
|
|
90
|
-
"env": {
|
|
91
|
-
"GITEA_HOST": "https://gitea.example.com",
|
|
92
|
-
"GITEA_TOKEN": "your-token"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### D) Any MCP-capable client
|
|
98
|
-
|
|
99
|
-
For any MCP client, register a command-based server with:
|
|
100
|
-
|
|
101
|
-
- `command: "bun"` and `args: ["x", "@foundation0/api", "f0-mcp", ...flags]`, or
|
|
102
|
-
- `command: "f0-mcp"` if installed globally.
|
|
103
|
-
|
|
104
|
-
Add environment variables for host/token and optional `MCP_TOOLS_PREFIX`.
|
|
105
|
-
|
|
106
|
-
## 4) Optional server flags
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
f0-mcp --help
|
|
110
|
-
|
|
111
|
-
# examples
|
|
112
|
-
f0-mcp --tools-prefix=example --server-name=my-example
|
|
113
|
-
f0-mcp --tools-prefix api --server-version 1.2.3
|
|
114
|
-
f0-mcp --allowed-root-endpoints projects
|
|
115
|
-
f0-mcp --allowed-root-endpoints agents,projects
|
|
116
|
-
f0-mcp --disable-write
|
|
117
|
-
f0-mcp --allowed-root-endpoints projects --disable-write
|
|
118
|
-
f0-mcp --disable-write --enable-issues
|
|
119
|
-
f0-mcp --admin
|
|
120
|
-
f0-mcp --admin --disable-write --enable-issues
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
- `--tools-prefix` is useful when running multiple MCP servers side-by-side.
|
|
124
|
-
- `--server-name` and `--server-version` are mostly metadata but can help identify logs and client tool sets.
|
|
125
|
-
- `--allowed-root-endpoints` restricts exposed tools to selected root namespaces (`agents`, `projects`).
|
|
126
|
-
- `--disable-write` removes write-capable tools (for example create/update/delete/sync/set/main/run operations).
|
|
127
|
-
- `--enable-issues` is a special-case override for `--disable-write`: issue endpoints remain enabled (`fetchGitTasks`, `readGitTask`, `writeGitTask`).
|
|
128
|
-
- `projects.syncTasks` and `projects.clearIssues` are admin-only and hidden by default; they are exposed only with `--admin` (or `MCP_ADMIN=true`).
|
|
1
|
+
# example-org MCP Server
|
|
2
|
+
|
|
3
|
+
Install and register the example-org MCP server with the MCP-enabled agent/tooling you use.
|
|
4
|
+
|
|
5
|
+
## 1) Install
|
|
6
|
+
|
|
7
|
+
Option A: install from npm (recommended for agent machines)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -g @foundation0/api
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Option B: run from npm without installing
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm dlx @foundation0/api f0-mcp --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The runnable entrypoint is `f0-mcp` (available from `bin` when installed globally).
|
|
20
|
+
|
|
21
|
+
## 2) Environment
|
|
22
|
+
|
|
23
|
+
The server supports:
|
|
24
|
+
|
|
25
|
+
- `GITEA_HOST` (recommended, required by git-backed tools)
|
|
26
|
+
- `FALLBACK_GITEA_HOST` (fallback host variable)
|
|
27
|
+
- `GITEA_TOKEN` (for authenticated actions)
|
|
28
|
+
- `MCP_TOOLS_PREFIX` (or `--tools-prefix`) to namespace tools in clients
|
|
29
|
+
- `MCP_ALLOWED_ROOT_ENDPOINTS` (or `--allowed-root-endpoints`) to whitelist API root endpoints
|
|
30
|
+
- `MCP_DISABLE_WRITE` (or `--disable-write`) to expose read-only tools only
|
|
31
|
+
- `MCP_ENABLE_ISSUES` (or `--enable-issues`) to allow issue endpoints when write mode is disabled
|
|
32
|
+
- `MCP_ADMIN` (or `--admin`) to expose admin-only destructive endpoints
|
|
33
|
+
|
|
34
|
+
Useful defaults:
|
|
35
|
+
|
|
36
|
+
- default server name: `f0-mcp`
|
|
37
|
+
- default server version: `1.0.0`
|
|
38
|
+
|
|
39
|
+
## 3) Registering with different MCP agents
|
|
40
|
+
|
|
41
|
+
### A) `.codex/config.toml`
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
[mcp_servers.example]
|
|
45
|
+
command = "bun"
|
|
46
|
+
args = ["x", "@foundation0/api", "f0-mcp"]
|
|
47
|
+
enabled = true
|
|
48
|
+
startup_timeout_ms = 20_000
|
|
49
|
+
env = {
|
|
50
|
+
GITEA_HOST = "https://gitea.example.com",
|
|
51
|
+
GITEA_TOKEN = "your-token",
|
|
52
|
+
MCP_TOOLS_PREFIX = "example"
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If you installed globally with `pnpm add -g`, swap `command` to:
|
|
57
|
+
|
|
58
|
+
```toml
|
|
59
|
+
command = "f0-mcp"
|
|
60
|
+
args = []
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### B) Claude Desktop (`claude_desktop_config.json`)
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"example": {
|
|
69
|
+
"command": "bun",
|
|
70
|
+
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "example"],
|
|
71
|
+
"env": {
|
|
72
|
+
"GITEA_HOST": "https://gitea.example.com",
|
|
73
|
+
"GITEA_TOKEN": "your-token"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use `command: "f0-mcp"` instead of `bun run ...` if you prefer the global install.
|
|
81
|
+
|
|
82
|
+
### C) Cursor
|
|
83
|
+
|
|
84
|
+
Use the same command/args/env block in your MCP server configuration area:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"command": "bun",
|
|
89
|
+
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "example"],
|
|
90
|
+
"env": {
|
|
91
|
+
"GITEA_HOST": "https://gitea.example.com",
|
|
92
|
+
"GITEA_TOKEN": "your-token"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### D) Any MCP-capable client
|
|
98
|
+
|
|
99
|
+
For any MCP client, register a command-based server with:
|
|
100
|
+
|
|
101
|
+
- `command: "bun"` and `args: ["x", "@foundation0/api", "f0-mcp", ...flags]`, or
|
|
102
|
+
- `command: "f0-mcp"` if installed globally.
|
|
103
|
+
|
|
104
|
+
Add environment variables for host/token and optional `MCP_TOOLS_PREFIX`.
|
|
105
|
+
|
|
106
|
+
## 4) Optional server flags
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
f0-mcp --help
|
|
110
|
+
|
|
111
|
+
# examples
|
|
112
|
+
f0-mcp --tools-prefix=example --server-name=my-example
|
|
113
|
+
f0-mcp --tools-prefix api --server-version 1.2.3
|
|
114
|
+
f0-mcp --allowed-root-endpoints projects
|
|
115
|
+
f0-mcp --allowed-root-endpoints agents,projects
|
|
116
|
+
f0-mcp --disable-write
|
|
117
|
+
f0-mcp --allowed-root-endpoints projects --disable-write
|
|
118
|
+
f0-mcp --disable-write --enable-issues
|
|
119
|
+
f0-mcp --admin
|
|
120
|
+
f0-mcp --admin --disable-write --enable-issues
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- `--tools-prefix` is useful when running multiple MCP servers side-by-side.
|
|
124
|
+
- `--server-name` and `--server-version` are mostly metadata but can help identify logs and client tool sets.
|
|
125
|
+
- `--allowed-root-endpoints` restricts exposed tools to selected root namespaces (`agents`, `projects`).
|
|
126
|
+
- `--disable-write` removes write-capable tools (for example create/update/delete/sync/set/main/run operations).
|
|
127
|
+
- `--enable-issues` is a special-case override for `--disable-write`: issue endpoints remain enabled (`fetchGitTasks`, `readGitTask`, `writeGitTask`).
|
|
128
|
+
- `projects.syncTasks` and `projects.clearIssues` are admin-only and hidden by default; they are exposed only with `--admin` (or `MCP_ADMIN=true`).
|