Skip to content

Conversation

@vibegui
Copy link
Contributor

@vibegui vibegui commented Jan 6, 2026

Summary by cubic

Adds robust STDIO MCP connection support with environment-based credentials and stable process management. Improves hot-reload stability.

  • New Features

    • Issue infinite JWTs for STDIO and pass credentials via MESH_TOKEN, MESH_URL, and MESH_STATE env vars; HTTP tokens remain 5 minutes.
    • Proxy exposes getConfigurationToken/getMeshUrl and includes mesh context in ON_MCP_CONFIGURATION for STDIO.
    • Stable STDIO transport: PID capture, process-tree kill, pool reset; app resets pool on startup/HMR.
    • UI: “Refresh Tools” button in connection settings.
    • Docs: STDIO connection guide (EN/PT-BR), README updates, and AGENTS.md documentation requirements.
  • Bug Fixes

    • Persist JWT secret and ContextFactory via globalThis to survive HMR.
    • Detect dead STDIO clients on reuse and respawn cleanly.
    • Tests updated to new issueMeshToken options API.

Written for commit af27cb0. Summary will update on new commits.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🧪 Benchmark

Should we run the MCP Gateway benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Release Options

Should a new version be published when this PR is merged?

React with an emoji to vote on the release type:

Reaction Type Next Version
👍 Prerelease 1.2.1-alpha.1
🎉 Patch 1.2.1
❤️ Minor 1.3.0
🚀 Major 2.0.0

Current version: 1.2.0

Deployment

  • Deploy to production (triggers ArgoCD sync after Docker image is published)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 14 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/docs/client/src/content/pt-br/mcp-mesh/mcp-servers.mdx">

<violation number="1" location="apps/docs/client/src/content/pt-br/mcp-mesh/mcp-servers.mdx:64">
P2: The example uses `connectionId` but this variable is never defined. Consider adding a placeholder definition or a comment explaining where it comes from.</violation>
</file>

<file name="apps/docs/client/src/content/en/mcp-mesh/mcp-servers.mdx">

<violation number="1" location="apps/docs/client/src/content/en/mcp-mesh/mcp-servers.mdx:60">
P2: The code example references `connectionId` which is never defined or explained. Consider adding a comment explaining where this value comes from, or defining it (perhaps from `state`).</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

const state = process.env.MESH_STATE ? JSON.parse(process.env.MESH_STATE) : {};

// Usar token para chamadas à API mesh
const response = await fetch(`${meshUrl}/mcp/${connectionId}`, {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The example uses connectionId but this variable is never defined. Consider adding a placeholder definition or a comment explaining where it comes from.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/docs/client/src/content/pt-br/mcp-mesh/mcp-servers.mdx, line 64:

<comment>The example uses `connectionId` but this variable is never defined. Consider adding a placeholder definition or a comment explaining where it comes from.</comment>

<file context>
@@ -1,24 +1,86 @@
+const state = process.env.MESH_STATE ? JSON.parse(process.env.MESH_STATE) : {};
+
+// Usar token para chamadas à API mesh
+const response = await fetch(`${meshUrl}/mcp/${connectionId}`, {
+  headers: { Authorization: `Bearer ${meshToken}` },
+  // ...
</file context>

✅ Addressed in 4e7fe45

const state = process.env.MESH_STATE ? JSON.parse(process.env.MESH_STATE) : {};

// Use token for mesh API calls
const response = await fetch(`${meshUrl}/mcp/${connectionId}`, {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The code example references connectionId which is never defined or explained. Consider adding a comment explaining where this value comes from, or defining it (perhaps from state).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/docs/client/src/content/en/mcp-mesh/mcp-servers.mdx, line 60:

<comment>The code example references `connectionId` which is never defined or explained. Consider adding a comment explaining where this value comes from, or defining it (perhaps from `state`).</comment>

<file context>
@@ -8,7 +8,69 @@ import Callout from &quot;../../../components/ui/Callout.astro&quot;;
+const state = process.env.MESH_STATE ? JSON.parse(process.env.MESH_STATE) : {};
+
+// Use token for mesh API calls
+const response = await fetch(`${meshUrl}/mcp/${connectionId}`, {
+  headers: { Authorization: `Bearer ${meshToken}` },
+  // ...
</file context>

✅ Addressed in 0c31351

@vibegui vibegui force-pushed the feat/stdio-connection-support branch 2 times, most recently from 525871e to fe66674 Compare January 8, 2026 18:11
@vibegui vibegui mentioned this pull request Jan 8, 2026
4 tasks
@vibegui vibegui force-pushed the feat/stdio-connection-support branch 4 times, most recently from 5c12f7a to 1d3989b Compare January 9, 2026 01:43
- Added documentation requirements to ensure updates accompany code changes.
- Introduced a new section on STDIO connections in README.md, detailing environment variable usage for local MCPs.
- Expanded the MCP servers documentation to clarify connection types and token handling.
- Implemented a reset mechanism for STDIO connections to refresh credentials on app restart.
- Updated JWT handling to support infinite tokens for STDIO connections.
- Improved error handling and logging in connection management.

This commit aims to improve developer experience and maintain accurate documentation alongside code changes.
@vibegui vibegui force-pushed the feat/stdio-connection-support branch from 1d3989b to af27cb0 Compare January 10, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants