Skip to content

Commit 50a2d9d

Browse files
Zecherehclaude
andauthored
feat(pi): package scaffold and MCP registration (PF-3852) (#40)
Adds the `@tiny-fish/pi` package manifest so the Pi coding agent can install TinyFish with `pi install npm:@tiny-fish/pi`. Skills land in the next commit; this is the registration surface only. Three decisions worth reviewing here, all verified against pi 0.84.4 and pi-mcp-adapter 2.32.1: | Field | Why | |---|---| | `directTools` | The adapter routes everything through a single `mcp` proxy tool by default (`direct-tools.ts:182-205`). Without this the package registers zero visible tools. Eight named rather than `true`, matching what the skills call and the adapter's own 5-20 guidance; the other ~11 stay reachable via the proxy. | | `X-API-Key: "${TINYFISH_API_KEY}"` | Key-only. Any `headers` key disables the adapter's OAuth auto-detect (`mcp-auth-flow.ts:1075`), so this route has no browser sign-in. Deliberate; the CLI route covers OAuth. | | no `type: "http"` | `ServerEntry` has no `type` field, only `httpTransport`. A bare `url` already means HTTP. | Note the interpolation form: `${TINYFISH_API_KEY}`, not the `${VAR:-}` default syntax the Claude plugin uses. The adapter's regex is `/\$\{(\w+)\}/`, which does not match a trailing `:-`, so that form would ship as a literal header. `X-TF-Client-Name`/`X-TF-Client-Version` follow the convention in the root README. The MCP route does not read them today — it reads only `x-tf-request-origin`, while the client-name headers are consumed by the v1 REST routes — so they are inert for now and carried for when it does. Verified they do not disturb the connection: a live session still authenticates and returns results with them present. Because the version is hardcoded there, it duplicates package.json's with nothing keeping the two in step, and a release would silently keep reporting the previous version. Guarded by a new `pi-versions-match` job in plugin-manifests-ci.yml, the same shape as the existing marketplace check; negative-tested by bumping package.json and confirming the job fails. The MCP URL carries no attribution params. `connectSourceSchema` has no value meaning "shipped inside a package", and `connect_attempt_id` is an install-level UUID — one baked into a tarball would be identical for every install, collapsing the whole population into a single attempt. Matches what claude/ and grok/ ship. Claude-Session: https://claude.ai/code/session_01CBf5rnVYQYcxE8bLjfQuUP Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 6c40641 commit 50a2d9d

5 files changed

Lines changed: 110 additions & 0 deletions

File tree

.github/workflows/plugin-manifests-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- ".github/workflows/plugin-manifests-ci.yml"
88
- ".claude-plugin/**"
99
- "claude/**"
10+
- "pi/**"
1011
push:
1112
branches: [main]
1213
paths:
1314
- ".github/workflows/plugin-manifests-ci.yml"
1415
- ".claude-plugin/**"
1516
- "claude/**"
17+
- "pi/**"
1618

1719
permissions:
1820
contents: read
@@ -36,3 +38,22 @@ jobs:
3638
echo "::error file=.claude-plugin/marketplace.json::plugin entry is $entry but claude/.claude-plugin/plugin.json is $plugin"
3739
exit 1
3840
fi
41+
42+
pi-versions-match:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v6
47+
48+
# mcp.json hardcodes the version it reports as X-TF-Client-Version; nothing else keeps
49+
# it in step with package.json, so a release would silently report the previous version.
50+
- name: MCP client version matches the package version
51+
run: |
52+
set -euo pipefail
53+
pkg=$(jq -re '.version' pi/package.json)
54+
hdr=$(jq -re '.mcpServers.tinyfish.headers["X-TF-Client-Version"]' pi/mcp.json)
55+
echo "package.json=$pkg mcp.json=$hdr"
56+
if [ "$pkg" != "$hdr" ]; then
57+
echo "::error file=pi/mcp.json::X-TF-Client-Version is $hdr but pi/package.json is $pkg"
58+
exit 1
59+
fi

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ TinyFish Web Agent provides AI-powered web automation using natural language ins
2121
| [LangChain](./langchain) | `langchain-tinyfish` — TinyFish Search, Fetch, Web Agent, and Browser as LangChain tools |
2222
| [Google ADK](./google-adk) | `tinyfish-adk` — TinyFish tools for the Google Agent Development Kit |
2323
| [Hermes](./hermes) | `tinyfish-hermes` — TinyFish Search and Fetch as a [Hermes Agent](https://github.com/NousResearch/Hermes-Agent) web provider plugin |
24+
| [Pi](./pi) | `@tiny-fish/pi` — TinyFish skills and MCP server for the [Pi coding agent](https://pi.dev) |
2425
| [n8n](./n8n) | Community node for the [n8n](https://n8n.io) workflow automation platform |
2526

2627
## Contribution guidelines

pi/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 TinyFish
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.

pi/mcp.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"mcpServers": {
3+
"tinyfish": {
4+
"url": "https://agent.tinyfish.ai/mcp",
5+
"headers": {
6+
"X-API-Key": "${TINYFISH_API_KEY}",
7+
"X-TF-Client-Name": "pi",
8+
"X-TF-Client-Version": "0.1.0"
9+
},
10+
"directTools": [
11+
"search",
12+
"fetch_content",
13+
"run_web_automation",
14+
"run_web_automation_async",
15+
"get_run",
16+
"cancel_run",
17+
"batch_status",
18+
"batch_cancel",
19+
"create_browser_session",
20+
"close_browser_session"
21+
]
22+
}
23+
}
24+
}

pi/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@tiny-fish/pi",
3+
"version": "0.1.0",
4+
"description": "TinyFish for the Pi coding agent — free web search and page reading, plus goal-driven browser automation on live and logged-in sites. Skills work standalone; the bundled MCP server activates if you also install pi-mcp-adapter.",
5+
"license": "MIT",
6+
"homepage": "https://docs.tinyfish.ai",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/tinyfish-io/tinyfish-web-agent-integrations.git",
10+
"directory": "pi"
11+
},
12+
"author": {
13+
"name": "TinyFish",
14+
"email": "support@tinyfish.io",
15+
"url": "https://tinyfish.ai"
16+
},
17+
"keywords": [
18+
"pi-package",
19+
"tinyfish",
20+
"web-agent",
21+
"browser-automation",
22+
"web-scraping",
23+
"data-extraction",
24+
"search",
25+
"fetch"
26+
],
27+
"files": [
28+
"skills",
29+
"rules",
30+
"mcp.json",
31+
"README.md",
32+
"LICENSE"
33+
],
34+
"publishConfig": {
35+
"access": "public"
36+
},
37+
"pi": {
38+
"mcp": "./mcp.json",
39+
"skills": [
40+
"./skills"
41+
]
42+
}
43+
}

0 commit comments

Comments
 (0)