agentleFS
infeniainfenia/yukta/mcp/CLAUDE.md

yukta / mcp

CLAUDE.md1 starsChanged 20 days agoApache-2.0View on GitHub

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every executionId-scoped tool verifies session ownership via ControlBusGateway.getProgress(sessionId, executionId) (ExecutionOwnership.

    line 60
  2. Very specific:

    Follow the tiered "Test Execution Policy (speed)" in the root CLAUDE.md: run --tests for the classes you changed first.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

MCP Module CLAUDE.md

Overview

MCP server implementation and tool providers. Mirrors the functionality of the web REST controllers as an agent-friendly MCP tool surface backed directly by core services (no dependency on :web).

Build & Development Commands

# Run MCP tests
yk gradle :mcp:test

Tools (AppMcpTools)

  • Sessions: list_sessions, get_session_details, create_session, get_session_creation_instructions
  • Workflows: get_workflow_details, start_workflow, get_workflow_status (WorkflowProgress snapshot), get_workflow_history, get_execution_logs (real logs from PluginLogStore, regex filter + tail)
  • Control: control_workflow (PAUSE/RESUME/STOP/STOP_ALL/RESTART/RESTART_FROM_NODE), control_node (PAUSE/RESUME/STOP/STEP/STEP_ENABLE/STEP_DISABLE)
  • Input requests (InputProvider): list_pending_inputs (VIEWER; bounded: 50 entries, texts cut to 2000 characters), answer_input and escalate_input (OPERATOR; sessionId is required like every execution-scoped tool). Tool descriptions say that prompts and context are untrusted.
  • Notifications (NotificationProvider): list_notifications (VIEWER; the caller's inbox, at most 50, bodies cut to 1000 characters) and mark_notifications_read (VIEWER; ids, or all). Both filter through Recipients (a session-limited key needs no sessionId: the filter does the scoping) and return wrapper records; titles and bodies are untrusted. An action carries the executionId and requestId for answer_input.
  • Plugins: list_plugins, get_plugin_details, list_ai_backends, get_plugin_creation_guide
  • Monitoring: get_control_bus_status, get_metrics_snapshot (sampled meters plus per-scope run aggregates from MetricsProvider)

Key Files

  • src/main/java/com/infenia/yukta/mcp/AppMcpTools.java: @McpTool facade.
  • src/main/java/com/infenia/yukta/mcp/AppMcpPrompts.java: @McpPrompt templates.
  • src/main/java/com/infenia/yukta/mcp/AppMcpResources.java: @McpResource providers.
  • src/main/java/com/infenia/yukta/mcp/provider/: Backing implementations (workflow execution/control, logs, sessions, plugins, system health) delegating to core services (ControlBusGateway, WorkflowService, SessionService, PluginRegistry, PluginLogStore).
  • src/main/java/com/infenia/yukta/mcp/dto/: MCP-owned response records (plain records, no swagger annotations). Core records (WorkflowProgress, WorkflowExecutionSummary, WorkflowDefinition) are returned directly where already clean.
  • ../docs/contributing/modules/mcp.mdx (module guide); open risks, bugs and review findings: GitHub issues labelled mcp (gh issue list -l mcp; risks also carry risk); evolution path and quality lenses: ../design/assessments/mcp.md.

Conventions & Gotchas

  • Tool params use @McpToolParam(required, description); @McpArg is only for @McpPrompt arguments.
  • The server runs type: ASYNC + protocol: STATELESS (configured in boot/src/main/resources/application*.yaml). Tools return Mono; blocking core calls are wrapped in Mono.fromCallable(...).subscribeOn(Schedulers.boundedElastic()).
  • List-shaped tools MUST return Mono<WrapperRecord> (e.g. SessionList, WorkflowHistory, PluginList), never Flux<T> or bare Mono<List<T>>: the async MCP tool callback truncates a Flux result to its first element (fluxResult.next()), and generateOutputSchema = true on a Mono<List<T>> return type crashes server startup (Spring AI 2.0.0 passes null to ClassUtils.isPrimitiveOrWrapper for parameterized types).
  • A null in a tool result fails the call ("output validation failed") unless the schema allows it: the server validates the result map against the generated output schema, which types a field as a plain string. Every dto/ record carries @JsonInclude(JsonInclude.Include.NON_NULL) (a null is left out) and every component that can be null is @Nullable (so it is not required). A core record shared with the REST API uses @Schema(nullable = true) @Nullable instead, which keeps the REST JSON as it is. ToolOutputSchemaTest checks every @Nullable component of every tool result.
  • Errors surface as Mono.error(new IllegalArgumentException(...)) with agent-actionable messages; the framework converts them to isError tool results.
  • Every executionId-scoped tool verifies session ownership via ControlBusGateway.getProgress(sessionId, executionId) (ExecutionOwnership; survives the tracker's index TTL); a missing execution and a foreign session yield the identical "Execution not found" error (mirrors WorkflowController.executeControlSignal).

Tech Stack

  • Spring AI MCP Server (WebFlux, Spring AI 2.0)

Imports

@.claude/rules/coding-standards.md @.claude/rules/git-workflow.md

Testing speed

Follow the tiered "Test Execution Policy (speed)" in the root CLAUDE.md: run --tests for the classes you changed first; full :mcp:test only when many files changed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.