@foundation0/api 1.0.0 → 1.0.1
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 +113 -0
- package/package.json +4 -1
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# F0 MCP Server
|
|
2
|
+
|
|
3
|
+
Install and register the F0 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
|
+
- `F0_GITEA_HOST` (fallback host variable)
|
|
27
|
+
- `GITEA_TOKEN` (for authenticated actions)
|
|
28
|
+
- `MCP_TOOLS_PREFIX` (or `--tools-prefix`) to namespace tools in clients
|
|
29
|
+
|
|
30
|
+
Useful defaults:
|
|
31
|
+
|
|
32
|
+
- default server name: `f0-mcp`
|
|
33
|
+
- default server version: `1.0.0`
|
|
34
|
+
|
|
35
|
+
## 3) Registering with different MCP agents
|
|
36
|
+
|
|
37
|
+
### A) `.codex/config.toml`
|
|
38
|
+
|
|
39
|
+
```toml
|
|
40
|
+
[mcp_servers.f0]
|
|
41
|
+
command = "bun"
|
|
42
|
+
args = ["x", "@foundation0/api", "f0-mcp"]
|
|
43
|
+
enabled = true
|
|
44
|
+
startup_timeout_ms = 20_000
|
|
45
|
+
env = {
|
|
46
|
+
GITEA_HOST = "https://gitea.example.com",
|
|
47
|
+
GITEA_TOKEN = "your-token",
|
|
48
|
+
MCP_TOOLS_PREFIX = "f0"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If you installed globally with `pnpm add -g`, swap `command` to:
|
|
53
|
+
|
|
54
|
+
```toml
|
|
55
|
+
command = "f0-mcp"
|
|
56
|
+
args = []
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### B) Claude Desktop (`claude_desktop_config.json`)
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"f0": {
|
|
65
|
+
"command": "bun",
|
|
66
|
+
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "f0"],
|
|
67
|
+
"env": {
|
|
68
|
+
"GITEA_HOST": "https://gitea.example.com",
|
|
69
|
+
"GITEA_TOKEN": "your-token"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use `command: "f0-mcp"` instead of `bun run ...` if you prefer the global install.
|
|
77
|
+
|
|
78
|
+
### C) Cursor
|
|
79
|
+
|
|
80
|
+
Use the same command/args/env block in your MCP server configuration area:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"command": "bun",
|
|
85
|
+
"args": ["x", "@foundation0/api", "f0-mcp", "--tools-prefix", "f0"],
|
|
86
|
+
"env": {
|
|
87
|
+
"GITEA_HOST": "https://gitea.example.com",
|
|
88
|
+
"GITEA_TOKEN": "your-token"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### D) Any MCP-capable client
|
|
94
|
+
|
|
95
|
+
For any MCP client, register a command-based server with:
|
|
96
|
+
|
|
97
|
+
- `command: "bun"` and `args: ["x", "@foundation0/api", "f0-mcp", ...flags]`, or
|
|
98
|
+
- `command: "f0-mcp"` if installed globally.
|
|
99
|
+
|
|
100
|
+
Add environment variables for host/token and optional `MCP_TOOLS_PREFIX`.
|
|
101
|
+
|
|
102
|
+
## 4) Optional server flags
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
f0-mcp --help
|
|
106
|
+
|
|
107
|
+
# examples
|
|
108
|
+
f0-mcp --tools-prefix=f0 --server-name=my-f0
|
|
109
|
+
f0-mcp --tools-prefix api --server-version 1.2.3
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- `--tools-prefix` is useful when running multiple MCP servers side-by-side.
|
|
113
|
+
- `--server-name` and `--server-version` are mostly metadata but can help identify logs and client tool sets.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundation0/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Foundation 0 API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"access": "public",
|
|
29
29
|
"registry": "https://registry.npmjs.org/"
|
|
30
30
|
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.13.0"
|
|
33
|
+
},
|
|
31
34
|
"scripts": {
|
|
32
35
|
"build:git": "bun build ../git/packages/git/src/index.ts --target bun --format esm --minify --outfile ./dist/git.js",
|
|
33
36
|
"mcp": "bun run mcp/cli.ts",
|