Skip to content

feat: add public feature request chat app#2405

Open
viktormarinho wants to merge 1 commit intomainfrom
feature-request-app
Open

feat: add public feature request chat app#2405
viktormarinho wants to merge 1 commit intomainfrom
feature-request-app

Conversation

@viktormarinho
Copy link
Contributor

@viktormarinho viktormarinho commented Feb 6, 2026

Summary

Adds a new Next.js app at apps/feature-request/ — a public-facing chat page where users can propose features for MCP Mesh. An AI "tech lead" persona reads the codebase via MCP tools, asks clarifying product/UX questions, builds a structured plan, and creates a GitHub issue.

  • Zero changes to apps/mesh/ — this is a standalone consumer of Mesh's existing decopilot streaming API, authenticated via API key
  • 15 new files, 812 lines — Next.js 15, AI SDK v3, Tailwind v4, @deco/ui design system
  • Deploys to Vercel with zero config (or any platform that runs Next.js)

How it works

Browser → POST /api/chat → Next.js API route → Mesh decopilot/stream (Bearer API key)
                                ↓
                         Virtual MCP agent
                                ↓
                    GitHub MCP tools (read code, create issues)
  1. User describes a feature idea in the chat
  2. The AI silently reads the codebase via GitHub MCP tools, asks product-oriented clarifying questions
  3. Builds a two-layer plan: user-facing summary + technical implementation notes
  4. Creates a GitHub issue with the full plan when the user approves

Key files

File Purpose
app/api/chat/route.ts Proxy to Mesh — injects API key, system prompt, model/agent config
app/page.tsx Chat page with empty state, ice breakers, message list, input
lib/system-prompt.ts Tech lead persona: translates code into plain language, asks UX questions
middleware.ts IP-based rate limiting (5 req/min) to prevent abuse
components/chat-messages.tsx Message rendering with friendly tool call indicators ("Reading file...", "Creating issue...")

Configuration

All config via env vars (.env.local for dev, Vercel dashboard for prod):

MESH_URL=http://localhost:3000
MESH_API_KEY=mk_xxx
MESH_ORG_SLUG=my-org
AGENT_ID=vir_xxx           # Virtual MCP with GitHub MCP connected
MODEL_CONNECTION_ID=conn_xxx
MODEL_ID=google/gemini-2.5-flash
TOOL_MODE=smart_tool_selection

Required MCP tools (GitHub MCP server)

The virtual MCP agent needs a GitHub MCP connection with toolsets: repos,issues,context,git — specifically: get_file_contents, search_code, get_repository_tree, list_commits, search_issues, list_issues, issue_write, get_me.

Test plan

  • Set up a virtual MCP agent in Mesh with GitHub MCP connection
  • Create an API key in Mesh, configure .env.local
  • Run bun run dev (Mesh on :3000) and cd apps/feature-request && bun run dev (on :3003)
  • Open localhost:3003, describe a feature, verify the AI reads code and asks clarifying questions
  • Verify issue creation flow works end-to-end
  • Verify rate limiting returns 429 after 5 rapid requests
  • Run next build to confirm production build succeeds

Made with Cursor


Summary by cubic

Add a standalone Next.js app at apps/feature-request for public feature requests via chat; a virtual tech lead reads the codebase with MCP tools, asks clarifying questions, drafts a plan, and can create a GitHub issue. It proxies Mesh’s decopilot stream with an API key and does not change apps/mesh.

  • New Features

    • Chat UI with empty state, ice breakers, message list, and input
    • Tool-call indicators (e.g., Reading file, Creating issue)
    • Next.js API route that injects the system prompt and streams from Mesh
    • IP-based rate limiting (5 req/min)
    • Env-based config; deploys on Vercel without extra setup
  • Migration

    • Set env vars: MESH_URL, MESH_API_KEY, MESH_ORG_SLUG, AGENT_ID, MODEL_CONNECTION_ID, MODEL_ID, TOOL_MODE
    • Ensure the virtual MCP agent has GitHub tools: repos, issues, context, git
    • Run the app at apps/feature-request and verify end-to-end issue creation

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

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.

1 issue found across 15 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/feature-request/app/api/chat/route.ts">

<violation number="1" location="apps/feature-request/app/api/chat/route.ts:43">
P2: Validate that `messages` is an array before spreading it. As written, a malformed or missing `messages` field will throw and return a 500 instead of a client error.</violation>
</file>

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

role: "system",
parts: [{ type: "text", text: SYSTEM_PROMPT }],
},
...messages,
Copy link
Contributor

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

Choose a reason for hiding this comment

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

P2: Validate that messages is an array before spreading it. As written, a malformed or missing messages field will throw and return a 500 instead of a client error.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/feature-request/app/api/chat/route.ts, line 43:

<comment>Validate that `messages` is an array before spreading it. As written, a malformed or missing `messages` field will throw and return a 500 instead of a client error.</comment>

<file context>
@@ -0,0 +1,78 @@
+          role: "system",
+          parts: [{ type: "text", text: SYSTEM_PROMPT }],
+        },
+        ...messages,
+      ],
+      model: {
</file context>
Fix with Cubic

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.

1 participant