Back to Overview
Pro

MCP Server for AI agents

Vallenta Studio hosts a local MCP server. Through it, an AI agent reads the Delphi model the IDE uses: symbol resolution, references, implementations, completion, diagnostics, the active project's configuration and the build pipeline. GitHub Copilot agent mode and Claude Code connect to it. Each answer is produced by the language server or the build pipeline, not by a text search over the source. Debugging over MCP is coming soon.

Vallenta Studio - GitHub Copilot, references and build over MCP

Two prompts in Copilot agent mode. "find all references of TWeatherStation" is answered from the language server's index with 12 locations; "build the project" runs the Build toolbar's pipeline and returns configuration, platform, error and warning counts.

find_referencesbuildCopilot agent mode
Overview

The model the IDE uses, over MCP

An AI agent normally works from the source text: it searches the files for a name and reads the matches. A text match carries no semantic information. It does not show which of several same-named declarations a name refers to, that Object Pascal identifiers are case-insensitive (TFoo and tfoo are one symbol), or that a code branch excluded by an {$IFDEF} for the selected configuration and platform is not compiled at all. Whether the project builds is known only after a build.

The MCP server supplies the answers the IDE has: the language server that runs for each project resolves names, references and implementations, and the build pipeline reports the result of a build. An agent locates a symbol, reads its declaration, lists its references and implementations, reads the active project's configuration, starts a build and reads the errors.

Source edits are performed by the agent's own file tools; they are not part of the MCP surface. Debugging over MCP, with breakpoints, launch, stepping and inspection, is coming soon.

Connect an agent

Connected in one step

GitHub Copilot, agent mode

VS Code 1.102 and later discover the server automatically. The Vallenta Studio tools are listed in agent mode while the server runs; no configuration file is edited.

Claude Code

The MCP Server card on the settings page registers the server with the Claude Code CLI for the current workspace, and removes the registration again. Registration runs the claude CLI, so the access token is written to Claude's user-private configuration and not into the repository. Copy connect command copies the claude mcp add line for a CLI that is not on PATH.

Any MCP client

The server speaks MCP over streamable HTTP at http://127.0.0.1:<port>/mcp and requires a bearer token. MCP: Show Server Status displays the URL. The port is assigned automatically and remembered per workspace, or fixed in the workspace settings.

Vallenta Studio - Settings, MCP Server card
The MCP Server card on the Vallenta Studio settings page: the enable switch, the port field, the running URL on 127.0.0.1, and the buttons Register with Claude Code, Remove registration and Copy connect command.

Enable switch, port, the running URL and the Claude Code registration buttons.

On by defaultRegister to any AI Agent
Key Features

Resolved semantics, tool by tool

Symbols resolved by the language server

find_symbol locates a type, routine or unit by name. get_symbol_info returns the declaration, type and signature. go_to returns the definition, the implementation body or the declaration. Names resolve case-insensitively and by uses-clause visibility: a same-named type in a unit the file does not use is reported as a different symbol.

References and implementations

find_references returns every use of a symbol across the project, .dfm and .fmx files included; overloads are returned as one name group. find_implementations returns the classes that implement an interface or the methods that override a virtual. Both read the index the editor's Find All References reads.

Completion, outline, diagnostics, inactive code

get_completions returns the members of an expression or the units a uses clause can take. get_document_symbols returns the outline of a file, get_diagnostics the language server's problems for a file, get_inactive_regions the lines switched off by {$IFDEF} under the selected configuration and platform.

Project model and build control

get_projects and get_project_info return the registered projects, the selected configuration and platform, defines, search paths and the unit list; set_build_config changes configuration or platform. build compiles the selected project through the MSBuild pipeline the Build button runs and returns errors, warnings and diagnostics as structured records. cancel_build stops a build; get_build_output returns the output of a build that outlasts the agent's tool timeout.

Coming soon

Debug sessions driven by the agent

start_debugging launches the active project as F5 does; attach_debugger attaches to a running process by pid or image name. add_breakpoints sets source and routine breakpoints (Unit.TClass.Method) with conditions in Delphi syntax, hit counts and logpoint messages. run_until_stop, step, pause and run_to_line return the next stop: reason, location, hit breakpoints, exception.

Coming soon

Inspection at a stop

get_stop_snapshot returns the stop, the top frames and the locals in one result. get_variables and expand_value return an object's [Properties] and [Fields]; evaluate runs an expression through the Delphi expression evaluator; get_exception returns class and message; get_debug_output returns the program's and the debugger's output, logpoint messages included. Values are rendered in Delphi form: [waWind, waFrost], wcStormy, (12, 18, 7, 21).

As recorded

One conversation, as recorded

References, then a build

GitHub Copilot, agent mode
find all references of TWeatherStation
  • Ran find_symbol - Vallenta Studio (MCP Server)
  • Ran find_references - Vallenta Studio (MCP Server)

Found 12 references to TWeatherStation: Weather.Types.pas:51 (declaration), WeatherReport.dpr:16, Weather.Formatter.pas:12, :13, :77, :87, Weather.Data.pas:8, :9, :10, :17, :76, :87.

build the project
  • Ran build - Vallenta Studio (MCP Server)

Build succeeded for WeatherReport.dproj. Configuration: Debug. Platform: Win32. Errors: 0. Warnings: 0. Compiler output: 100 lines, 0.19 seconds.

The tool calls listed are the ones Copilot selected from the server's instructions. The same tools are available to Claude Code and to any MCP client.

The Tools

The tools, by group

Code intelligence · 9
  • find_symbolLocates a type, routine or unit by name
  • go_toDefinition, implementation body or declaration of a symbol
  • find_referencesEvery use of a symbol, overload group included
  • find_implementationsClasses implementing an interface, methods overriding a virtual
  • get_symbol_infoDeclaration, type and signature of a symbol
  • get_completionsMembers of an expression, or the units a uses clause can take
  • get_document_symbolsOutline of one file
  • get_diagnosticsThe language server's problems for one file
  • get_inactive_regionsLines switched off by the preprocessor
Project and build · 7
  • get_projectsRegistered projects and the selected one
  • get_project_infoConfiguration, platform, defines, search paths, unit list
  • set_build_configChanges the selected configuration or platform
  • buildCompiles the selected project; structured errors and warnings
  • cancel_buildStops a running build
  • get_build_outputOutput of the current or last build
  • set_active_projectComing soonMakes a registered project the active one
Debug session and breakpoints · 9Coming soon
  • get_debug_stateSession state, current stop, expression syntax, exception rules
  • list_processesAttach candidates with debug access, symbol state and platform
  • start_debuggingLaunches the active project as F5 does
  • attach_debuggerAttaches to a running process by pid or image name
  • end_debug_sessionTerminates a launched program or detaches
  • add_breakpointsSource and routine breakpoints with condition, hit count, logpoint
  • remove_breakpointsRemoves breakpoints
  • get_breakpointsBreakpoints and their verification state
  • set_exception_rulesException classes the debugger skips
Execution and inspection · 14Coming soon
  • run_until_stopContinues and returns the next stop
  • stepStep over, into or out; statement or instruction
  • pausePauses a running program
  • wait_for_stopWaits for a stop after a timed-out execution tool
  • run_to_lineRuns to a source line
  • get_stop_snapshotThe stop, the top frames and the locals in one result
  • get_stackFrames of a thread, routines in Delphi spelling
  • get_threadsThreads of the session
  • get_variablesLocals or registers of a frame
  • expand_valueChildren behind a value handle, [Properties] and [Fields]
  • evaluateAn expression in Delphi syntax
  • get_exceptionClass and message of the exception the program stopped on
  • get_debug_outputProgram output and debugger output, logpoint messages included
  • get_modulesLoaded modules with their symbol state
What the server tells the agent

Instructions delivered at connect

At connection the server sends its usage instructions to the agent: which tool answers which question, and the Object Pascal rules a text search does not apply.

  • Identifiers are case-insensitive: TFoo, tfoo and TFOO are one symbol.
  • Visibility follows the uses clause, not the directory. A same-named type in a unit the file does not use is a different symbol.
  • Overloaded routines share one reference set; find_references returns the whole name group.
  • Code in an inactive {$IFDEF} branch is not dead text; which branch is active depends on the selected configuration and platform.
  • get_diagnostics reports the language server's semantic validation; build is ground truth.
  • Text search is reserved for .dfm and .dproj files, comments and string literals.
Recipes named in the instructions
  • Change a signature safelyget_symbol_infofind_referenceseditbuild
  • Fix a failing buildbuildgo_toeditbuild
  • Add a unit to a uses clauseget_completions at the uses clause; the units returned are the reachable ones, which excludes circular-reference candidates
Coming soon

Debugging over MCP

The next release adds 24 debugging tools. An agent launches the active project or attaches to a running process, sets breakpoints with conditions in Delphi syntax, hit counts and logpoint messages, runs and steps with each stop returned in the reply, and reads the call stack, threads, locals, expression values, the current exception and the program output. The tools drive the session shown in VS Code's Run and Debug view, so every stop is visible and the session can be paused or ended from the IDE at any time. Win32 and Win64 first; Linux64 follows.

Vallenta Studio - GitHub Copilot driving the debugger over MCP (preview)

One prompt: set a breakpoint at WatchShowcase.pas line 196, start the project, list the locals at the stop. Copilot calls add_breakpoints, start_debugging and get_stop_snapshot; the Run and Debug view shows the same session.

Coming soonadd_breakpointsget_stop_snapshot

Breakpoint, launch, locals

GitHub Copilot, agent mode
Set a breakpoint at WatchShowcase.pas line 196, start the project, at the breakpoint list all local variables and their values.
  • Ran add_breakpoints - Vallenta Studio (MCP Server)
  • Ran start_debugging - Vallenta Studio (MCP Server)
  • Ran get_stop_snapshot - Vallenta Studio (MCP Server)

Breakpoint hit at WatchShowcase.pas:196 in WatchShowcase.ShowcaseScene. Alerts: [waWind, waFrost] · Condition: wcStormy (3) · Headline: 'Detailed [80%]: Storm front moving in from the west' · IsSevere: True · Location: 'Vienna Central' · Report: TDailyReport($03352E80) · ShortValue: 'SHORT' · Temperatures: (12, 18, 7, 21) · vTest: 80. The debug session remains stopped at the breakpoint.

  • Execution tools wait up to vallenta.studio.mcp.debugWaitSeconds (default 30 s); a timeout returns timedOut while the program keeps running.
  • Breakpoints set by the agent appear in the Breakpoints view and persist per project.
  • One Delphi debug session per window, shared with the Run and Debug view.
  • The last 5000 lines of program and debugger output are kept per session.
  • Recipe in the instructions, reproduce a bug: add_breakpointsstart_debuggingget_stop_snapshotevaluatestepend_debug_session
Also included
On by default for Pro - vallenta.studio.mcp.enabled stops the server; the free tier has no server.
One server per window - the port is assigned automatically and remembered per workspace, or fixed with vallenta.studio.mcp.port in the workspace settings.
Commands - MCP: Show Server Status, MCP: Copy Claude Code Connect Command, MCP: Register With Claude Code, MCP: Remove Claude Code Registration.
Builds that outlast the client - the build continues past the agent's tool timeout; get_build_output returns its result.
Indexing note - while the symbol index is still filling, results carry an indexing note and the instructions direct the agent to repeat the query.
Capped lists are marked - a completion list cut at its cap is reported as truncated.
How it works

How a tool call is answered

Each VS Code window hosts one MCP server inside the extension. A tool call is answered by the language server that runs for the project (symbols, references, completion, diagnostics) or by the build pipeline (the MSBuild invocation the Build button runs, with structured output). No source is re-parsed for the agent. With the next release, debugging calls are answered by the debug session through the debug adapter the Run and Debug view uses, so Delphi rendering, deferred conditions and the exception ignore list apply unchanged.

AI agent
GitHub Copilot agent mode, Claude Code, any MCP client
Vallenta Studio MCP server
One per window; 127.0.0.1, bearer token
Language server per project
LSP
Build pipeline
MSBuild
Debug session
Coming soon
DAP

Local only

  • The server listens on 127.0.0.1 and is not reachable from the network.
  • Every request carries a bearer token; requests with a foreign host header are rejected.
  • The token is written to the agent's user-private configuration, never into the repository.
  • vallenta.studio.mcp.enabled set to false stops the server.
  • The server sends nothing to any model. What an agent sends to its model is governed by the agent.

Scope

  • Read and build. Source edits and renames are not performed over MCP; a rename tool with preview is planned.
  • Debugging over MCP is coming soon: Win32 and Win64 first, Linux64 follows.
  • Requires a Pro subscription or the trial. Automatic discovery requires VS Code 1.102 or later; older versions connect through the connect command.

Delphi code intelligence for AI agents, with Vallenta Studio Pro

Included in the Pro plan. Every Pro feature is available free for 5 days after registration.