Skip to content

Commit 829de68

Browse files
authored
Merge pull request #67 from Accenture/feat/mcp-recipes-github
feat(mcp-binding): pin GitHub's hosted server in the recipes (RFC-0013 step 5)
2 parents da8f93f + a4671a1 commit 829de68

7 files changed

Lines changed: 139 additions & 14 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@
7676
pinned), Neo4j's Cypher server, GitHub's hosted server and Playwright's browser - with every environment-specific
7777
value a `${NAME:default}` reference and every credential a reference without a default. The binding does not load
7878
the file; an entry is copied into `mcp-servers.yml` and its tools declared with `bind` as before.
79-
`tests/vectors/mcp-recipes.json`, shared byte for byte with the Node.js pack, pins the input-schema digests of the
80-
six servers that list their tools without a credential (56 tools, read 2026-11-18 through both packs' `describe`,
81-
identical), and `tests/test_mcp_recipes.py` loads the recipes file on every run and, with `MCP_RECIPES_LIVE=1`,
82-
starts each server through the binding's own probe and compares the digests, so a recipe that rots fails by name.
79+
`tests/vectors/mcp-recipes.json`, shared byte for byte with the Node.js pack, pins the input-schema digests of all
80+
seven servers (95 tools, read 2026-11-18 through both packs' `describe`, identical; GitHub's hosted server with a
81+
maintainer's token - 39 tools of its three default toolsets, 22 of them under the read-only header), and
82+
`tests/test_mcp_recipes.py` loads the recipes file on every run and, with `MCP_RECIPES_LIVE=1`, starts each server
83+
through the binding's own probe and compares the digests (GitHub's when `GITHUB_MCP_TOKEN` is set, in both modes), so
84+
a recipe that rots fails by name.
8385

8486
### Fixed
8587

‎extensions/mcp-binding/README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ servers Git, Time, Fetch and Filesystem (started with `uvx` and `npx`, versions
130130
hosted server and Playwright's browser. Every environment-specific value is a `${NAME:default}` reference and every
131131
credential a reference without a default. The binding does not read the file: copy an entry into `mcp-servers.yml`,
132132
set the references it names, run `describe` on it and declare the tools you want with `bind` and a function, as above.
133-
The page carries the digests of the six servers that list their tools without a credential, read on 2026-11-18 from
134-
the pinned versions, and `tests/test_mcp_recipes.py` re-reads them live when `MCP_RECIPES_LIVE=1` is set (the Neo4j
135-
server also wants `NEO4J_PASSWORD` and a database): a recipe that rots fails at the digest, as the boot would.
133+
The page carries the digests of all seven servers, read on 2026-11-18 from the pinned versions (GitHub's with a
134+
maintainer's token), and `tests/test_mcp_recipes.py` re-reads them live when `MCP_RECIPES_LIVE=1` is set (the Neo4j
135+
server also wants `NEO4J_PASSWORD` and a database, GitHub's `GITHUB_MCP_TOKEN`): a recipe that rots fails at the
136+
digest, as the boot would.
136137

137138
## The function contract
138139

‎extensions/mcp-binding/resources/mcp-recipes.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ servers:
6262
NEO4J_DATABASE: '${NEO4J_DATABASE:neo4j}'
6363
# GitHub's server (vendor server). The hosted endpoint over streamable HTTP with a fine-grained
6464
# personal access token of least privilege (or the deployment's GitHub App token); the toolsets
65-
# header selects the tool families, the read-only header hides every write. The listing needs the
66-
# credential, so its digests are not pinned on the page: run describe with the token and pin what it
67-
# prints. A self-hosted alternative is the vendor's container image over stdio.
65+
# header selects the tool families (the default lists 39 tools), the read-only header hides the
66+
# seventeen that write. The listing needs the credential: the page's digests were read with a
67+
# maintainer's token, and the gated test checks them when GITHUB_MCP_TOKEN is set. A self-hosted
68+
# alternative is the vendor's container image over stdio.
6869
github:
6970
transport: http
7071
url: 'https://api.githubcopilot.com/mcp/'

‎memory/open-threads/thread-bp-agent-tools-python.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
versions, not loaded by default), the shared digest vector `tests/vectors/mcp-recipes.json` (56 tools of the six
1919
servers that list without a credential, read through `describe`, identical from both packs) and
2020
`tests/test_mcp_recipes.py` (five tests on every run, six gated live on `MCP_RECIPES_LIVE=1`; 11 passed live; PR #66, merge `8db480a`, MERGED
21-
2026-11-18); the page is the engine's `docs/guides/tools-from-mcp-servers.md`. Next: nothing until Eric rules on RFC-0013's promotion. The plan as settled - step 1: `extensions/agent-tools/agent_tools.py` (the layout of `extensions/mcp-binding`: a module docstring, a
21+
2026-11-18); the page is the engine's `docs/guides/tools-from-mcp-servers.md`. GitHub's digests pinned the same day with Eric's
22+
token (39 tools, 22 under the read-only header; two live tests gated on `GITHUB_MCP_TOKEN`; PR #67). Next: nothing
23+
until Eric rules on RFC-0013's promotion. The plan as settled - step 1: `extensions/agent-tools/agent_tools.py` (the layout of `extensions/mcp-binding`: a module docstring, a
2224
`README.md`, `resources/application.yml`, a `describe` command printing every catalog row, `platform.on_startup` for the
2325
gated registration) with the file tools inside `tools.file.root` (`file.read`, `file.write` marked `write: true` with
2426
`create` the default, `file.list`, `file.search`; paths resolved with symlinks followed and refused outside the root;

‎memory/sessions/2026-11-18-090840.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@
3737

3838
Opened as PR #66; **MERGED 2026-11-18** (merge `8db480a`).
3939

40+
## Later the same day - GitHub's digests pinned
41+
42+
- Eric merged #66, #132 and #648, generated a fine-grained token and set `GITHUB_MCP_TOKEN` in the shell; he ran
43+
`describe github` himself too and it worked. The hosted server listed 22 tools under the recipe's default
44+
`X-MCP-Readonly: true` and 39 with the header off (`repos,issues,pull_requests`), identical digests from both
45+
bindings; every output file was checked for the token's value before it was read (none).
46+
- `tests/vectors/mcp-recipes.json` gains `github` with the 39 digests and the `read_only_tools` list (95 tools in all,
47+
new pin in both packs); `tests/test_mcp_recipes.py` gains two live tests gated on the token: the read-only listing
48+
is exactly the pinned reads, and the full listing carries every pinned digest. Both passed live; the plain suite is
49+
green. The recipe's comment, the README and the CHANGELOG item no longer say GitHub's digests are unpinned.
50+
- Seventeen of the server's tools write (`issue_write`, `create_pull_request`, `push_files`, `merge_pull_request`,
51+
...) and the read-only header hides exactly those; several of its descriptions instruct a chat assistant, which the
52+
page now cites as a second case for rewriting the row. The token is only needed for the live run; CI skips it.
53+
- Opened as PR #67.
54+
4055
## Memory References
4156

4257
- Referenced: bp-agent-tools-python (edited: step 5's pack half), mcp-binding-function-per-tool (the bind shape the

‎tests/test_mcp_recipes.py‎

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
_RECIPES = _BINDING.parent / "resources" / "mcp-recipes.yml"
2828
_DIGESTS = _TESTS / "vectors" / "mcp-recipes.json"
2929
# the Node.js twin pins the same digest: change the file in both packs or in neither
30-
_DIGESTS_SHA256 = "10c70fe179d315cb0932d56cf0bc1e11290eb7c922ff439e5b9e7944df437d53"
30+
_DIGESTS_SHA256 = "844e729bc41e667892ecd5a6e864568b2c10d4785f0624864c91834074b47aac"
3131

3232
# the module name tests/test_mcp_binding.py loads the binding under: one process executes the
3333
# module once, because a second execution would register mermaid.render again with a second function
@@ -55,7 +55,7 @@ def _load_binding() -> Any:
5555
DIGESTS: dict[str, Any] = json.loads(_DIGESTS.read_text(encoding="utf-8"))
5656
LIVE = bool(os.environ.get("MCP_RECIPES_LIVE"))
5757
RECIPE_SERVERS = ["fetch", "filesystem", "git", "github", "neo4j", "playwright", "time"]
58-
# the servers that list their tools without a credential - the ones the page pins
58+
# the servers that list their tools without a credential; GitHub's hosted server lists with a token
5959
CREDENTIAL_FREE = ["git", "time", "fetch", "filesystem", "playwright"]
6060
# a credential the file references but these tests never send gets a placeholder, so the file
6161
# loads; a real value already in the environment (the Neo4j run) is kept
@@ -114,7 +114,8 @@ def test_the_references_resolve_from_the_environment(recipes: dict[str, Any]) ->
114114

115115
def test_every_pinned_server_has_a_recipe_and_tools(recipes: dict[str, Any]) -> None:
116116
pinned = DIGESTS["servers"]
117-
assert sorted(pinned) == sorted(CREDENTIAL_FREE + ["neo4j"])
117+
assert sorted(pinned) == RECIPE_SERVERS
118+
assert set(pinned["github"]["read_only_tools"]) <= set(pinned["github"]["tools"])
118119
assert set(pinned) <= set(recipes)
119120
for name, server in pinned.items():
120121
assert server["tools"], name
@@ -163,3 +164,38 @@ async def test_live_neo4j_recipe_digests(recipes: dict[str, Any]) -> None:
163164
assert not missing and not changed, (
164165
f"the neo4j recipe rotted - missing {missing}, changed {changed}"
165166
)
167+
168+
169+
# --- GitHub's hosted server, live with a token (gated) -----------------------------------------
170+
171+
GITHUB_LIVE = LIVE and bool(os.environ.get("GITHUB_MCP_TOKEN"))
172+
GITHUB_REASON = (
173+
"set MCP_RECIPES_LIVE=1 and GITHUB_MCP_TOKEN (a fine-grained, read-only token) to list "
174+
"GitHub's hosted server"
175+
)
176+
177+
178+
@pytest.mark.skipif(not GITHUB_LIVE, reason=GITHUB_REASON)
179+
@pytest.mark.asyncio
180+
async def test_live_github_read_only_header_hides_every_write(recipes: dict[str, Any]) -> None:
181+
# the recipe's default, X-MCP-Readonly true: exactly the pinned read tools, with their digests
182+
actual = await offered_digests(recipes["github"])
183+
pinned = DIGESTS["servers"]["github"]
184+
expected = {name: pinned["tools"][name] for name in pinned["read_only_tools"]}
185+
assert actual == expected, "the read-only listing differs from the pinned read tools"
186+
187+
188+
@pytest.mark.skipif(not GITHUB_LIVE, reason=GITHUB_REASON)
189+
@pytest.mark.asyncio
190+
async def test_live_github_recipe_digests(
191+
monkeypatch: pytest.MonkeyPatch, recipes: dict[str, Any]
192+
) -> None:
193+
# with the writes listed: every pinned tool offered, with its digest
194+
assert "github" in recipes
195+
monkeypatch.setenv("GITHUB_MCP_READONLY", "false")
196+
github = {spec.name: spec for spec in binding.load_servers(str(_RECIPES))}["github"]
197+
actual = await offered_digests(github)
198+
missing, changed = rot(actual, DIGESTS["servers"]["github"]["tools"])
199+
assert not missing and not changed, (
200+
f"the github recipe rotted - missing {missing}, changed {changed}"
201+
)

‎tests/vectors/mcp-recipes.json‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,74 @@
8888
"browser_type": "ed892740ebc14bb2a49467c08b8bb02717d50f1f3ef8ed06d51abf5ebb3249da",
8989
"browser_wait_for": "cee58694f677034e21fc68446200888eb28469696b4ca9259047e15084fb22ff"
9090
}
91+
},
92+
"github": {
93+
"started_with": "https://api.githubcopilot.com/mcp/ with X-MCP-Toolsets: repos,issues,pull_requests (X-MCP-Readonly: false for the whole list; read_only_tools is the list under X-MCP-Readonly: true)",
94+
"read_only_tools": [
95+
"get_commit",
96+
"get_file_contents",
97+
"get_label",
98+
"get_latest_release",
99+
"get_release_by_tag",
100+
"get_tag",
101+
"issue_read",
102+
"list_branches",
103+
"list_commits",
104+
"list_issue_fields",
105+
"list_issue_types",
106+
"list_issues",
107+
"list_pull_requests",
108+
"list_releases",
109+
"list_repository_collaborators",
110+
"list_tags",
111+
"pull_request_read",
112+
"search_code",
113+
"search_commits",
114+
"search_issues",
115+
"search_pull_requests",
116+
"search_repositories"
117+
],
118+
"tools": {
119+
"add_comment_to_pending_review": "4db72d6ccc6cbf6c5a5a60db2269bdb78076bf2150838c932c4756fa16bc4667",
120+
"add_issue_comment": "d93b8edaabd74e3c655651f4fcd84fcb30d30bbd9b648cf3194c410faed2f282",
121+
"add_reply_to_pull_request_comment": "b3e21f358fb25d6e1e9b60c6b4133d50823f3401cb28a742b461b7f37bdc7951",
122+
"create_branch": "e65b73ec25a45f23ce7371d5a18b7d2bb749388c330c01f592f1c288016fc385",
123+
"create_or_update_file": "4bbfd9f8df3736e4897c2a0466b2131764d414c3075e3691711282eae7dc209e",
124+
"create_pull_request": "e249ccd5a1f2364cbfc0a5d9e11bebdc298626351cc7e43fd59b851c3d520238",
125+
"create_repository": "eb38a6e274e4b762d210740cdec57eacc9ebf0b5b87c013e32ee80406036f76b",
126+
"delete_file": "af29cf413864c65dee4ac821b10d15f9bb0673e2977d2298918b1317d160d4ba",
127+
"fork_repository": "ac52a51d95996c5af97cac680c7bc1b7dcc423061174a84c727dfd4a1d06b210",
128+
"get_commit": "f084d5addb427982ea2cb3064e8c7faf23ef2117009b17707ca1f3dca2e08945",
129+
"get_file_contents": "3e8fd49a5ed6d35c07b9b3d712312ffe317391a11f7fdd185fe7c86ed8a241bd",
130+
"get_label": "cf89e3a5ff5d176d7be8375ae68fdde2bb90a85a524cb39037d0bf2d272fa474",
131+
"get_latest_release": "6bd7211e72d2921f609892e467a7b293cc3ed176557cc391f736361ea718e021",
132+
"get_release_by_tag": "9012396d62f53b04de455a466203e7c9ee6c56fa9f61063f28e08c147cb881f9",
133+
"get_tag": "8b13651d5e7162c741afd862aa15fa2a1419c539ebcba092bfd07ef1ee88a82a",
134+
"issue_read": "4129cf817f37afefbc65885a75ba37817ae95f46ab9658b0b9de8c37d6b26c2e",
135+
"issue_write": "083aa952baecd960494979902818962438474a84f1985252f3024597e9442f5f",
136+
"list_branches": "cc4d347261dd31b2df9f0a36d7bd49a5acb4dba8043c857f70a5dfb74c6b7804",
137+
"list_commits": "591090af37df44793d29ce44be3afe0ec122e3ac2db6edc4e5db62d330b0a35c",
138+
"list_issue_fields": "ae44b8d0eadc50902f62a7907ab1c45dfbf95a71ec87ec4aa836fece8477c002",
139+
"list_issue_types": "fa18815229ec77ba88b9a249313ed41dd9e62382729cb72bc472587f1c06fb37",
140+
"list_issues": "ae3a1945a49d3648618475385a0d3647f107f57e40720f1889e2360b40a98d37",
141+
"list_pull_requests": "e1e093b013497fae6ca27152cc7d2ffed822ab389a5983e68773466bf83dc38b",
142+
"list_releases": "4118d959bb3b13749813d74442a4d143f9a2a0fad7ac5e23880fc5d1f1aace03",
143+
"list_repository_collaborators": "ee69edd2a4af5094260553c303fbc28db0a701ef28a9e93016aed005d6bc89a9",
144+
"list_tags": "cc4d347261dd31b2df9f0a36d7bd49a5acb4dba8043c857f70a5dfb74c6b7804",
145+
"merge_pull_request": "d6b25b3006b7124dc4a1d775458febd3e802fe1dd9ff61347fc9bdb5e0176a02",
146+
"pull_request_read": "380c0d04d38cb7ae46ac5862485e29277e353f7f7d868b558125e27be06017c1",
147+
"pull_request_review_write": "250438d8197b381022f562f96943dfab18a397fafaada3fdca3d3f18696fdf0b",
148+
"push_files": "63d80fecd0ff8d6b927f02faa499f858e13f79a008a6dfedaf04d8783194d51e",
149+
"search_code": "4ad473c9570e3a825e6d60c9869b87324e0a5d371cf293ffb70fd2b840358cf7",
150+
"search_commits": "e477f9b9a99ce91db99e3380c7272485b0ee66cf06d9415674918bc6e8c159f7",
151+
"search_issues": "a055d2bd8d73374c84787996a5dae3934ef1570fda9c0aa1ad7061038bc0e12e",
152+
"search_pull_requests": "1d885a55314d8a1aff83ac5536600429ac3ae089d0f760335fa8ed559e99a9a1",
153+
"search_repositories": "7b4cad1aba3867b93477594b3054d4e6a3b2fb2fa09ba9b7e11cb42b034a7902",
154+
"sub_issue_write": "8b4d8c72ba5b500c5fed41a86b4720f0bbb58eac1f58abf576fbc00d9a90a88b",
155+
"update_issue_comment": "a4a9d37cda657866581bd1a8ca5eb7d6c1af6626d050361b1a3e4d1f63950441",
156+
"update_pull_request": "f9ef3dae6c8d529fa50f1ebd23b6fe351c0def794deb20787d4b55a9503fb9e1",
157+
"update_pull_request_branch": "48c3c0aa12992defea00c3727690442719367b1210187d5da589234bde3b62b6"
158+
}
91159
}
92160
}
93161
}

0 commit comments

Comments
 (0)