# Reported issues for Rails AI Context

Pod holds 16 of 16 problems reported by people outside the maintainer team. Issues filed by the project's own owners, members and collaborators are excluded entirely — a maintainer's release checklist is not a warning to a prospective user.

Back to [Rails AI Context](/mcp/rails-ai-context).

## Most discussed

### CLI tool runner breaks with mcp 0.20.0: undefined method schema on InputSchema

## Summary

`rails-ai-context` v5.11.1 allows `mcp >= 0.8, < 2.0`, so Bundler can resolve to `mcp` v0.20.0. With that combination, `rails-ai-context tool ...` can fail before invoking the tool because the CLI runner calls `InputSchema#schema`, which no longer exists in `mcp` v0.20.0.

Pinning `mcp` to v0.19.0 makes the same command work again.

## Environment

- Ruby: 4.0.5
- Rails: 8.1.3
- rails-ai-context: 5.11.1
- Broken mcp version: 0.20.0
- Working mcp version: 0.19.0
- Mode: CLI-only

`rai

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/85) · 2026-06-15 · closed · external user · 2 comments

### MCP error -32600: Tool rails_get_context has an output schema but did not return structured content

### What happened?

```
rails_get_context (MCP: rails-ai-context) · model: "Location", include: [4 items]
  └ MCP server 'rails-ai-context': McpError: MCP error -32600: Tool rails_get_context has an output schema but did not
    return structured content

✗ rails_analyze_feature (MCP: rails-ai-context) · feature: "location"
  └ MCP server 'rails-ai-context': McpError: MCP error -32600: Tool rails_analyze_feature has an output schema but did not
    return structured content

✗ rails_search_code 

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/69) · 2026-04-12 · closed · external user · 2 comments

### rails-ai-context init records tool_mode where no in-app surface reads it

\`rails-ai-context init\` inside a Gemfile app records \`tool_mode\` only into \`.rails-ai-context.yml\` (exe/rails-ai-context:471-479, via \`extra_yaml\`). \`SelectionRecord.write_initializer\` (lib/rails_ai_context/install/selection_record.rb:191-217) handles the \`ai_tools\` line and nothing else, and in-Gemfile surfaces never load the YAML (see the re-prompt issue). The recorded mode is inert.

**Mechanism**

Two stores for the selection, one writer that only knows half the keys, and a reade

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/148) · 2026-08-16 · closed · 1 comment

### MCP edge: one error frame, one transport factory

## Parent

Part of #109.

## What to build

The three JSON-RPC error-frame copies and the two mutex-guarded transport constructions become one shared builder and one factory. The engine controller keeps its streaming, flush and header behavior untouched.

## Acceptance criteria

- [ ] One module builds the internal-error frame; the standalone rack app, the middleware and the engine controller consume it; both "Mirror" comments are gone.
- [ ] One factory constructs the transport under one memoiz

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/118) · 2026-08-10 · closed · 1 comment

### rails_query always fails on MySQL: "Transaction characteristics can't be changed while a transaction is in progress" (SET TRANSACTION READ ONLY inside conn.transaction)

## Summary

On MySQL with recent Rails, every `rails_query` call fails with:

```
SQL error: Mysql2::Error: Transaction characteristics can't be changed while a transaction is in progress
```

This affects plain queries and `explain: true` (which routes through the same wrapper). The error message misleads agents into diagnosing a "stuck transaction" and restarting the MCP server, which doesn't help — the failure is deterministic.

## Environment

- rails-ai-context 5.12.0
- Rails 8.1.3, Ruby 3.

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/89) · 2026-07-09 · closed · outside contributor · 1 comment

### feat: Claude Code integration improvements — paths frontmatter, @imports, settings.json

## Summary

Deep audit of our Claude Code implementation against the current Claude Code spec (2026). Our CLAUDE.md generation, .claude/rules/, and .mcp.json are solid. The main improvements are: adding `paths:` frontmatter for conditional rule loading, leveraging `@path` imports, and generating `.claude/settings.json` for MCP auto-approval.

## What We Did Well (Verified)

| Area | Status | Source |
|---|---|---|
| CLAUDE.md as primary file | ✅ Correct | [Official docs](https://code.claude.com/

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/54) · 2026-04-08 · closed · 1 comment

### feat: OpenCode integration improvements — opencode.json MCP config, instructions key, additional rules

## Summary

Deep audit of our OpenCode implementation against the current OpenCode spec (v1.4.0, April 2026). Our AGENTS.md generation and directory-level split rules are solid. The main gap is missing `opencode.json` auto-generation for MCP server registration — same class of issue as the Cursor `.cursor/mcp.json` gap (#52).

## What We Did Well (Verified)

| Area | Status | Source |
|---|---|---|
| `AGENTS.md` as primary file | ✅ Correct | [OpenCode rules docs](https://opencode.ai/docs/rules/)

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/53) · 2026-04-08 · closed · 1 comment

### feat: Cursor integration improvements — MCP config, token budget, rule types

## Summary

Deep audit of our Cursor implementation against the current Cursor spec (2026). Our `.cursor/rules/*.mdc` generation is solid, but there are gaps in MCP auto-discovery, token budget, and rule type coverage.

## What We Did Well (Verified from codebase)

| Area | Status | Notes |
|---|---|---|
| `.cursor/rules/` directory | ✅ Correct | Not deprecated `.cursorrules` |
| `.mdc` extension | ✅ Correct | MDC format |
| Frontmatter fields | ✅ Correct | Only `description`, `globs`, `alwaysAp

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/52) · 2026-04-08 · closed · 1 comment

## Most recent

### `serve --transport http` inherits the app's Puma cluster config, so about half of all requests answer "Session not found"

Against Mastodon, with a valid `Mcp-Session-Id` echoed from `initialize`:

```
$ curl -X POST http://127.0.0.1:6041/mcp -H "Mcp-Session-Id: 20c53b43-..." \
    -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Session not found"}}
```

Retrying the identical request with the identical session id succeeds. Which requests fail is random. Over 20 sequential `tools/list` calls on one session: **9 succeeded, 11 answered "Session not found

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/123) · 2026-08-11 · closed · 0 comments

### feat: Add OpenAI Codex support (serializer, install path, MCP config)

## Summary

Add OpenAI Codex as a supported AI tool alongside Claude Code, Cursor, GitHub Copilot, and OpenCode.

[OpenAI Codex](https://github.com/openai/codex) is an open-source (Apache 2.0) CLI coding agent by OpenAI with **73k+ GitHub stars**. It has first-class MCP support and uses `AGENTS.md` as its primary context file — making integration with rails-ai-context straightforward.

## Research Findings (Verified)

### How Codex consumes context
- **Primary file:** `AGENTS.md` (same conventio

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/51) · 2026-04-08 · closed · 1 comment

### Phase 3: Dynamic VFS & Live Resource Architecture

**Parent:** #36
**Depends on:** #37 (Phase 1), #38 (Phase 2)

## Goal

Eliminate stale files. Every MCP resource is introspected fresh in-memory on every request. Replace static file generation (Rake tasks, CLAUDE.md, .cursorrules, serializer file writers) with a live Virtual File System backed by Prism AST.

## Gems

| Gem | Role |
|-----|------|
| `mcp` | Official MCP Ruby SDK — tools, resources, resource templates, notifications (already present) |
| `listen` | File watcher → AST cache invali

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/39) · 2026-04-07 · closed · 1 comment

### Ground Truth Engine — Engineering Blueprint (v6.0)

## Ground Truth Engine — Engineering Blueprint

> Transform the gem from a **Static Context Provider** to a **Dynamic Intelligence Layer**.
> Constraint: deepen the existing 38 tools. No new tools added.

## Execution Order

```
Phase 1: Introspectors  →  Prism AST foundation
Phase 2: Tools          →  Semantic hydration layer
Phase 3: MCP/Resources  →  Dynamic VFS (official MCP SDK)
Phase 4: Serializers    →  Token-sniper compression
Phase 5: Doctor.rb      →  Executable diagnostics
```

## Eng

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/36) · 2026-04-07 · closed · 1 comment

### Add middleware error handling and markdown escaping for dynamic content

## Problem 1: Middleware crash

`middleware.rb` line 22: `transport.handle_request(request)` has no rescue. If the MCP transport raises, the exception propagates and crashes the Rails request pipeline. Same risk on line 33 during server initialization.

## Solution 1

Wrap MCP handling in `rescue => e`, return JSON-RPC 2.0 error response:

```ruby
rescue => e
  Rails.logger.error "[rails-ai-context] MCP request failed: #{e.class}: #{e.message}"
  json_rpc_error_response(e)  # Returns [500, heade

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/20) · 2026-04-04 · closed · 1 comment

### feat: rails_get_stimulus MCP tool — stimulus controller details

## Problem

1,107 lines of JS across 16 Stimulus controllers — completely invisible to current MCP tools. AI reads multiple JS files to understand existing frontend behavior.

## Proposed tool

```
rails_get_stimulus(detail: "summary")              → all controllers with targets/values/actions
rails_get_stimulus(controller: "filter_form")      → full detail for one controller
```

## Implementation

Already have `StimulusIntrospector` that extracts targets, values, actions, outlets, classes. Jus

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/8) · 2026-03-19 · closed · 0 comments

### feat: rails_get_view MCP tool — view templates, partials, layouts

## Problem

AI agents read 490+ lines of view files per feature task (index, show, new, partials, layout) because no MCP tool covers views. This is the biggest uncovered blind spot.

## Proposed tool

```
rails_get_view(controller: "cooks")                    → list all view files for controller
rails_get_view(path: "cooks/index")                    → full template content
rails_get_view(path: "cooks/index", detail: "summary") → structure: forms, partials used, stimulus controllers, CSS framewor

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/7) · 2026-03-19 · closed · 0 comments

### Bug: Thread-unsafe cache in BaseTool causes race conditions under Puma

## Description

`BaseTool.cached_context` uses unprotected class instance variables (`@cached_context`, `@cache_timestamp`, `@cache_fingerprint`) without any synchronization. In multi-threaded HTTP servers like Puma, concurrent MCP tool calls can race on the cache — triggering multiple expensive introspections simultaneously and potentially reading partially-written state.

Additionally, because Ruby class instance variables are per-class (not inherited), each of the 9 tool subclasses independen

[Read the thread](https://github.com/crisnahine/rails-ai-context/issues/2) · 2026-03-19 · closed · 0 comments

The remaining reports are on [the project's issue tracker](https://github.com/crisnahine/rails-ai-context/issues).
