Repository navigation
Add MCP resource support to tutorials: client, fixture server, and integration - #255
Conversation
5125d2a to
bc6e697
Compare
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc6e697f18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f3e69eabf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be75185ea8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2117933dd4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again, do not send bugs 1 by 1, batch all of them (if any) inside a single review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Under human review & testing now |
|
Let's do this differently without custom MCP server implementation |
|
Continues at #256 |
…256) - Replace the tutorial-only custom MCP fixture with a realistic third-party MCP/OAuth setup. - Keep the production tutorials deterministic and CI-friendly while showing a clearer separation between A2A agent communication and MCP resource access. - Make the local and Docker Compose tutorial workflows easy to discover and run. - Refactored Customer Support Copilot to use ContextForge `v1.0.10` for MCP resources and Keycloak `26.7.4` for OAuth. - Added a short-lived `client_credentials` flow for the `mcp-agent` client, verified HTTPS with an ephemeral local CA, and a least-privilege ContextForge service principal with `servers.use` and `resources.read`. - Added ContextForge bootstrap automation that configures Keycloak trust, registers the deterministic ticket resource, creates the virtual MCP server, requests the access token, and writes the runtime MCP environment for the specialist. - Simplified the shared C++ MCP client to a stateless MCP `2025-11-25` `resources/read` request with bearer authentication, bounded timeouts, response validation, and no token logging. - Added Docker Compose coverage for the authenticated Customer Support flow, including an unauthenticated rejection check and an authenticated MCP preflight before the A2A agents start. - Restored Job Application Assistant to its file-based A2A-only flow and removed the old custom MCP server fixture. - Kept host-native tutorial smoke deterministic through `scripts/run_tutorials.sh`. - Refactored the root and tutorial READMEs so the supported local and Docker Compose entry points are short, explicit, and consistent. - Updated MCP client unit tests for the stateless request/response behavior and error handling. --------- Co-authored-by: Vladimir Pavlov <[email protected]>
fd3d5e5 to
20570a6
Compare
|
Ok, no more custom MCP servers. Dockerized setup has already been verified on windows, however this PR requires another QA round on Linux and final doc. review. Extra neat features (like some UI for tutorials) should be out of scope. This PR demonstrates how tutorial app works with OAuth-protected MCP resource through Keycloak and ContextForge. |
|
Tested on Linux |
|
@codex pls review this PR, remember that tutorials are created for demo purposes, not for real production usage. The goal of tutorials is to demonstrate how production applications can be built with this SDK. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20570a682e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### Motivation - Prevent CRLF/header injection via user-supplied resource URIs that are copied into the `Mcp-Name` header and accepted by libcurl.\ - Enforce URI validation at both protobuf-boundary helpers and the MCP client boundary to fail-fast and avoid emitting attacker-controlled outbound headers.\ ### Description - Add `ValidateResourceUri(std::string_view, std::string_view)` in `examples/tutorials/common/resource_validation.h` which rejects empty values and any ASCII control characters (chars < 0x20 and DEL 0x7f).\ - Update `ValidateResourceUriField` to reuse `ValidateResourceUri` for protobuf string values.\ - Apply validation in `Client::ReadResource` (in `examples/tutorials/common/mcp_client.cpp`) before constructing the outbound request and headers, returning the validation error if the URI is invalid.\ - Add unit tests in `tests/unit/mcp_client_test.cpp` to cover CRLF/header-injection style input and other control characters, and update tests to set protobuf string values with `std::string` where needed.\
|
@codex review this PR again. Bear in mind that this is tutorials, not core SDK, so no nitpicking! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d05c0b0ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again, no nitpicks |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fdf2766ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Motivation
Description
examples/tutorials/common/mcp_client.{h,cpp}) that implements JSON-basedinitialize,notifications/initialized, andresources/readinteractions with session header handling and protocol validation.tutorial.*logic, and registering the MCP client in the agentExecutorconstructors.examples/tutorials/mcp_server/server.py), a lightweightDockerfileandrequirements.txt, and wire it intodocker-composefor both tutorials.mcp_client.cppinto tutorial libraries and add include directories; update README usage and run scripts to describe and start the MCP server and to use--*-resourceflags.scripts/run_tutorials.sh,scripts/run_tutorial_docker_smoke.sh) to start the MCP server, exercise resource URIs, and assert expected outputs and error handling (missing/unavailable resources).