ci: publish mcp package to npm
This commit is contained in:
37
.gitea/workflows/build.yml
Normal file
37
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout from in-cluster gitea
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
git clone --depth=1 \
|
||||||
|
"http://gitea_admin:${{ secrets.ADMIN_PW }}@gitea-http.gitea.svc.cluster.local:3000/gitea_admin/a2a-mcp.git" .
|
||||||
|
git checkout "$GITHUB_SHA"
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends ca-certificates curl
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||||
|
apt-get install -y --no-install-recommends nodejs
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
|
||||||
|
- name: install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: verify package contents
|
||||||
|
run: npm pack --dry-run
|
||||||
57
.gitea/workflows/publish.yml
Normal file
57
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["v*"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
npm:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout from in-cluster gitea
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
git clone --depth=1 --branch "${GITHUB_REF_NAME}" \
|
||||||
|
"http://gitea_admin:${{ secrets.ADMIN_PW }}@gitea-http.gitea.svc.cluster.local:3000/gitea_admin/a2a-mcp.git" .
|
||||||
|
git log -1 --oneline
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends ca-certificates curl
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||||
|
apt-get install -y --no-install-recommends nodejs
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
|
||||||
|
- name: install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: assert tag matches package version
|
||||||
|
run: |
|
||||||
|
PKG_VER=$(node -p "require('./package.json').version")
|
||||||
|
TAG_VER="${GITHUB_REF_NAME#v}"
|
||||||
|
echo "tag=$TAG_VER package=$PKG_VER"
|
||||||
|
if [ "$TAG_VER" != "$PKG_VER" ]; then
|
||||||
|
echo "tag $TAG_VER does not match package.json version $PKG_VER" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: verify package contents
|
||||||
|
run: npm pack --dry-run
|
||||||
|
|
||||||
|
- name: publish to npm
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$NODE_AUTH_TOKEN" ]; then
|
||||||
|
echo "NPM_TOKEN not set on this repo." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
npm publish --access public
|
||||||
43
README.md
Normal file
43
README.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# @a2a/mcp
|
||||||
|
|
||||||
|
MCP gateway for a2acloud agents. It runs locally as a stdio MCP server and
|
||||||
|
exposes deployed A2A agents as tools to Claude Code, Cursor, and other MCP
|
||||||
|
clients.
|
||||||
|
|
||||||
|
## Quickstart
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx -y @a2a/mcp login
|
||||||
|
npx -y @a2a/mcp add <agent-name>
|
||||||
|
npx -y @a2a/mcp doctor
|
||||||
|
```
|
||||||
|
|
||||||
|
Add it to your MCP client config:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"a2a": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["-y", "@a2a/mcp"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Restart the client after adding or removing agents.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
a2a-mcp login # save control-plane credentials
|
||||||
|
a2a-mcp whoami # show current account
|
||||||
|
a2a-mcp agents # list agents visible to your account
|
||||||
|
a2a-mcp add <name> # expose one agent through this gateway
|
||||||
|
a2a-mcp list # list locally enabled agents
|
||||||
|
a2a-mcp remove <name> # stop exposing an agent
|
||||||
|
a2a-mcp doctor # probe enabled agents and count tools
|
||||||
|
a2a-mcp logout # clear local credentials
|
||||||
|
```
|
||||||
|
|
||||||
|
Running `a2a-mcp` with no command starts the MCP gateway over stdio.
|
||||||
Reference in New Issue
Block a user