Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/publish-mcp-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Publish MCP Server to npm

# Publishes the `agentic-context-mcp` package (in mcp-server/) to npm whenever
# a tag matching `mcp-v*` is pushed, e.g. `mcp-v0.2.0`.
#
# Uses npm Trusted Publishing (OIDC) — no NPM_TOKEN secret required. This
# requires one-time setup by whoever owns the `agentic-context-mcp` package
# on npmjs.com, which cannot be done from this workflow file alone:
#
# 1. The package must already exist on npm. If it has never been published,
# the very first publish must be done manually from a maintainer's
# machine (`cd mcp-server && npm publish`), since a Trusted Publisher
# can only be configured for a package that already exists.
# 2. On npmjs.com, go to the package's Settings > Trusted Publisher, choose
# "GitHub Actions", and set:
# - Organization or user: the GitHub org/user owning this repo
# - Repository: this repository's name
# - Workflow filename: publish-mcp-server.yml (filename only)
# - Environment name: leave blank unless using a GitHub Environment
# 3. That's it — no GitHub secret needs to be added. Once configured, any
# push of a `mcp-v*` tag from this workflow is authenticated via a
# short-lived OIDC token, and npm publishes provenance automatically.
#
# See mcp-server/README.md's "Publishing a new version" section for the full
# release process (bumping the version, tagging, etc.).

on:
push:
tags:
- "mcp-v*"

permissions:
contents: read
id-token: write # required for npm Trusted Publishing (OIDC)

jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: mcp-server
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"

- name: Ensure npm supports Trusted Publishing (>= 11.5.1)
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Test
run: npm test

- name: Verify tag matches package.json version
run: |
TAG_VERSION="${GITHUB_REF_NAME#mcp-v}"
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "Tag mcp-v$TAG_VERSION does not match package.json version $PKG_VERSION"
exit 1
fi

- name: Determine npm dist-tag
id: npm-tag
run: |
# npm refuses to guess a dist-tag for prerelease versions (anything
# with a "-" per semver, e.g. 0.1.0-beta.1) — it must be explicit,
# or `npm publish` errors out. Derive it from the prerelease
# identifier (e.g. "beta" from "0.1.0-beta.1"); plain releases get
# "latest".
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *-* ]]; then
TAG="${VERSION#*-}"
TAG="${TAG%%.*}"
else
TAG="latest"
fi
echo "Publishing $VERSION with dist-tag: $TAG"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"

- name: Publish to npm
run: npm publish --provenance --access public --tag "${{ steps.npm-tag.outputs.tag }}"
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,25 @@ User says: "refactor the authentication module"

`AGENTS.md` is the **single source of truth** for project conventions. All agent config files redirect to it and to `.context/index.md`.

## Quick Start
## MCP Server (Alternative to Deploy)

Instead of copying files into every repository with `deploy.sh`, let agents query standards and playbooks on demand via the [`agentic-context-mcp`](https://www.npmjs.com/package/agentic-context-mcp) MCP server. No git clone, no build-time bundling, no local install even — it runs via `npx` and fetches markdown over HTTPS at request time (defaulting to `raw.githubusercontent.com` for this repo), caching it in memory for a few hours.

One command sets everything up — the MCP equivalent of `deploy.sh` — writing an MCP-flavoured `AGENTS.md`, per-agent redirect files, and each agent's MCP server registration:

```bash
npx agentic-context-mcp init --agents all
```

Teams that fork this repo and customise standards/playbooks for their own project can point it at their own published copy instead of upstream, as long as they publish the same directory layout (`core/AGENTS.md`, `core/.context/index.md`, `standards/*.md`, `playbooks/**/*.md`) to any static host (Azure Static Web Apps, Blob Storage static website, GitHub Pages, etc.):

```bash
npx agentic-context-mcp init --agents all --content-base-url https://your-team-host/agentic-context
```

The server exposes 9 tools (`search`, `get_index`, `get_agents_config`, `list_standards`, `get_standard`, `list_playbooks`, `get_playbook`, `list_conventions`, `get_convention`) that let any MCP-compatible agent load exactly the content it needs. See [`mcp-server/README.md`](mcp-server/README.md) for what `init` writes, manual configuration snippets per agent, and instructions for building the server itself from source.

## Quick Start (Deploy)

```bash
./deploy.sh --agents all /path/to/target-repo
Expand Down Expand Up @@ -139,6 +157,15 @@ playbooks/ Tier 2 — on demand (→ target .contex
discover-local-otel-stack.md
use-local-otel-stack.md
instrument-dotnet-otel.md

mcp-server/ MCP server (alternative to deploy.sh)
src/
cli.ts Bin entry — dispatches to server or init
server.ts MCP server — registers all tools
init.ts `init` command — MCP equivalent of deploy.sh
content.ts Fetches content over HTTPS with in-memory caching
package.json
tsconfig.json
```

> Scripts in `playbooks/setup/create-local-otel-stack/` are deployed to
Expand Down
2 changes: 2 additions & 0 deletions core/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ Available context types:
- **Playbooks** in `.context/playbooks/` — step-by-step procedures for assessments, reviews, plans, and refactoring
- **Conventions** in `.context/conventions/` — workflow, communication, and coding style guidance

> This repository was set up with `deploy.sh`/`deploy.ps1`, which copies these files locally. If you instead configured the `agentic-context-mcp` MCP server (see the [agentic-context repo](https://github.com/ldastey-dev/agentic-context)'s `mcp-server/`), run `npx agentic-context-mcp init` to generate an MCP-flavoured `AGENTS.md` instead of using this one.

---

## Mandated Standards
Expand Down
2 changes: 2 additions & 0 deletions mcp-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
build/
Loading