How the Ask Forge MCP server runs, how to add it to your AI client, which tools it lists, and how it guards the tools that change files or run against a database.
By the SchemaSmith Team · Last reviewed
Add the SchemaSmith MCP server to your AI assistant and every conversation becomes schema-aware.
The MCP server binary is named ForgeBarrett.Mcp (or ForgeBarrett.Mcp.exe on Windows). It communicates over stdio using the JSON-RPC-based Model Context Protocol (MCP 2025-03-26). When installed via the MSI installer, the binary is located at C:\Program Files\SchemaSmith\AskForge\ForgeBarrett.Mcp.exe. Getting Started covers installation.
Your AI client starts the server and talks to it over standard input and output. The server writes its startup messages and log to standard error, never to standard output, which carries only the protocol.
The server checks for an Ask Forge license as it starts, and exits if it finds none. It looks in the same places as the CLI, listed under License File.
The MCP server reads the same ~/.schemasmith/askforge.json configuration file as the CLI, so a database connection saved from either one is available to both. Configuration lists the connection fields.
Each client takes the same server entry. Add it once, and the client starts the server when it needs it.
| Client | Where the entry goes | Top-level key |
|---|---|---|
| Claude Code | Your project's .mcp.json |
mcpServers |
| Claude Desktop | Settings > Developer > Edit Config | mcpServers |
| VS Code | Your workspace's .vscode/mcp.json |
servers |
| Cursor | Cursor's MCP settings (Settings > MCP Servers) | mcpServers |
Point command at the executable. The entry is the same in every client; only the top-level key differs, as the table shows.
{
"mcpServers": {
"schemasmith": {
"command": "C:\\Program Files\\SchemaSmith\\AskForge\\ForgeBarrett.Mcp.exe",
"args": [],
"env": {
"SCHEMASMITH_PRODUCT_PATH": "C:\\path\\to\\your\\schema-package"
}
}
}
}
{
"mcpServers": {
"schemasmith": {
"command": "/path/to/ForgeBarrett.Mcp",
"args": [],
"env": {
"SCHEMASMITH_PRODUCT_PATH": "/path/to/your/schema-package"
}
}
}
}
SCHEMASMITH_PRODUCT_PATH is optional. The server starts without it, and you can load a product at any time with schemasmith_navigate_context, which also overrides the preloaded path at runtime. Passing --product-path <path> in args preloads it the same way, and the explicit argument takes precedence if both are set. If the path is missing or invalid, the server logs a warning to standard error and starts context-free.
Restart your AI client after updating the MCP configuration. Some clients cache the tool list.
Any MCP-compatible client can connect using stdio transport:
progressToken in its _meta gets the tool's progress lines as notifications/progress messages.notifications/cancelled message for a running tool call stops the tool and anything it started. A call the cancel stopped gets no reply.--shutdownTimeoutSeconds=<seconds> in the client's args, or set SCHEMASMITH_shutdownTimeoutSeconds.Configuration can also be set through environment variables prefixed with SCHEMASMITH_:
| Variable | What it sets |
|---|---|
SCHEMASMITH_PRODUCT_PATH |
A schema package to preload at server launch (optional). Equivalent to the --product-path argument, which takes precedence if both are set. |
SCHEMASMITH_ForgeBarrett__Platforms__Default |
The default platform: SqlServer (the default), PostgreSQL, MySQL or MariaDb. |
SCHEMASMITH_ForgeBarrett__Persona__Verbosity |
How much persona the server's startup message carries: None, Concise, Normal (the default) or Detailed. |
SCHEMASMITH_shutdownTimeoutSeconds |
How many seconds the server waits for cancelled tools to stop once your client closes its input, before it exits without them (default 30). Equivalent to the --shutdownTimeoutSeconds=<seconds> argument; this variable takes precedence if both are set. |
These override the appsettings.json installed beside the ForgeBarrett.Mcp executable, the only appsettings.json the server reads. An appsettings.json in the directory your MCP client launches the server from (typically your own project) is ignored. A setting passed on the server's command line (for example --ForgeBarrett:Persona:Verbosity=Concise in the client's args) also overrides the file.
Settings are applied in this order, each overriding the ones before it:
appsettings.<Environment>.json or ForgeBarrett.Mcp.settings.json beside the executable, if you add one. None is installed.So a variable without the prefix cannot change a setting the installed appsettings.json already sets, such as the default log level, Logging__LogLevel__Default. It can still set anything the file does not set. If a machine-wide variable like these is set for another .NET program, it reaches the MCP server too. Use the SCHEMASMITH_ prefix for a setting meant for the server.
When the MCP server connects, it sends an instructions field in the initialize response. AI assistants that support this field (including Claude) use it to guide their behavior. The server sends this text:
SchemaSmith MCP server for database schema management. Use navigate_context to set product/template before inspecting tables. Use search_knowledge before answering conceptual questions about SchemaSmith. Use discover_tools to find specialized tools not in the main tool list.
The instructions establish a recommended workflow:
schemasmith_search_knowledge: look up documentation and best practices before answering conceptual questions about SchemaSmith.schemasmith_discover_tools: find specialized tools when the task requires something not in the curated tool list.This means the AI does not need to know every SchemaSmith tool upfront. It follows the workflow and finds tools as it needs them.
The initialize response also names protocol version 2025-03-26 and these capabilities:
| Capability | Value | What it means |
|---|---|---|
tools.listChanged |
false |
The tool list stays the same while the server runs. |
resources.listChanged |
true |
The resource list changes when a product is loaded, and the server says so (see Resources and Prompts). |
prompts.listChanged |
false |
The prompt list stays the same while the server runs. |
completions |
enabled | The server answers completion/complete for prompt arguments. |
The MCP server surfaces a curated set of 46 tools directly in tools/list: the most-used Tier 1 and Tier 2 tools, plus schemasmith_discover_tools and schemasmith_execute_tool, plus every Tier 3 (Modify) and Tier 4 (External) tool, which are surfaced because they carry a confirm guard. Less-common Tier 1 and Tier 2 tools are left out of the list to keep token cost down, but remain fully accessible via schemasmith_discover_tools and schemasmith_execute_tool.
| Tool | Tier |
|---|---|
schemasmith_navigate_context | Tier 1: ReadOnly |
schemasmith_show_context | Tier 1: ReadOnly |
schemasmith_list_tables | Tier 1: ReadOnly |
schemasmith_show_table | Tier 1: ReadOnly |
schemasmith_search_schemas | Tier 1: ReadOnly |
schemasmith_dependencies | Tier 1: ReadOnly |
schemasmith_review_schema | Tier 1: ReadOnly |
schemasmith_validate_json | Tier 1: ReadOnly |
schemasmith_plan_migration | Tier 1: ReadOnly |
schemasmith_search_knowledge | Tier 1: ReadOnly |
schemasmith_suggest_changes | Tier 2: Generate |
schemasmith_generate_schema | Tier 2: Generate |
schemasmith_discover_tools searches every registered tool by keyword or capability description, regardless of how a tool is surfaced, and returns matching tool names, descriptions, tiers, and parameter schemas. schemasmith_execute_tool then runs one by name. Its tool_name is the name without the schemasmith_ prefix, and arguments is a JSON object of the tool's own arguments:
{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "schemasmith_execute_tool",
"arguments": {
"tool_name": "list_templates",
"arguments": {}
}
}
}
A tool reached this way keeps its tier and its confirm guard, as described under Annotations and Confirmation. The tools reference lists every tool, whichever way it is reached.
The MCP server provides tool annotations on every tool in tools/list, following the MCP 2025-03-26 specification. These annotations describe what each tool does, so AI agents can decide how to use it:
| Annotation | Purpose | How SchemaSmith uses it |
|---|---|---|
readOnlyHint |
Indicates the tool does not modify anything | true for every Tier 1 (ReadOnly) tool except schemasmith_navigate_context, which changes the server's working context |
destructiveHint |
Indicates the tool may delete or overwrite data | true for Tier 3 (Modify) and Tier 4 (External) tools |
idempotentHint |
Indicates repeated calls produce the same result | true for schemasmith_navigate_context |
openWorldHint |
Indicates the tool interacts with external systems | true for Tier 4 (External) tools that execute CLI subprocesses |
Tier 3 and Tier 4 tools require confirm: true in the call's arguments before they execute. Their tools/list entries declare the confirm parameter, and each description ends with [Requires confirm: true]. Tier 1 and Tier 2 tools run without it.
A call that leaves it out is not run. The server answers with what the tool would do, and how to confirm it:
This operation requires confirmation.
Tool: schemasmith_apply_change
Tier: Modify (Modifies files or creates packages)
Description: Modify schema JSON files to apply changes
To execute this tool, add 'confirm: true' to the arguments.
The same call with "confirm": true runs:
{
"jsonrpc": "2.0",
"id": 7,
"method": "tools/call",
"params": {
"name": "schemasmith_apply_change",
"arguments": {
"change_type": "add_column",
"table": "Customers",
"definition": "{\"Name\":\"Email\",\"DataType\":\"varchar(255)\"}",
"confirm": true
}
}
}
A dry run is no exception: schemasmith_run_schema_quench needs confirm: true even with dry_run: true.
Reaching a tool through schemasmith_execute_tool does not skip its confirm guard. The guard is keyed on the tool that will actually run, so a Tier 3 or Tier 4 target needs confirm: true on the schemasmith_execute_tool arguments, alongside tool_name, not inside the inner arguments JSON:
{
"jsonrpc": "2.0",
"id": 8,
"method": "tools/call",
"params": {
"name": "schemasmith_execute_tool",
"arguments": {
"tool_name": "apply_change",
"arguments": {
"change_type": "add_column",
"table": "Customers",
"definition": "{\"Name\":\"Email\",\"DataType\":\"varchar(255)\"}"
},
"confirm": true
}
}
}
schemasmith_execute_tool therefore always advertises a confirm property in tools/list, even though it is itself Tier 1: the tool it will run is not known until the call arrives, so the schema cannot declare the requirement conditionally. A call that omits it is refused with a message naming the resolved tool, its tier, and where the flag belongs, as in Tool: schemasmith_execute_tool -> apply_change.
Beyond tools, the MCP server also exposes resources and prompts via the MCP protocol.
Resources use the schemasmith:// URI scheme. AI clients that support MCP resources can read context information, platform capabilities, and schema data directly:
| URI | What it returns |
|---|---|
schemasmith://docs/overview |
An overview of the SchemaSmith toolset |
schemasmith://docs/platforms |
The database platforms SchemaSmith supports, with each one's capabilities |
schemasmith://config/connections |
The connections configured in askforge.json, with passwords masked |
schemasmith://knowledge/categories |
The knowledge base categories, with the number of articles in each |
schemasmith://product/info |
The loaded product: its name, platform and path, how many templates it has, and the current template and table |
schemasmith://product/templates |
The loaded product's templates, with a table count for each |
The two product resources are listed once a product is loaded. When schemasmith_navigate_context, schemasmith_create_table or schemasmith_rename_table succeeds, the server sends notifications/resources/list_changed, so a client knows to read the list again.
Resource templates take a name in the URI:
| URI template | What it returns |
|---|---|
schemasmith://template/{templateName}/info |
A template's metadata, from its Template.json |
schemasmith://table/{tableName} |
A table's full definition, as JSON |
schemasmith://table/{tableName}/columns |
The table's column definitions |
schemasmith://table/{tableName}/indexes |
The table's index definitions |
schemasmith://table/{tableName}/foreign-keys |
The table's foreign key definitions |
schemasmith://knowledge/{category} |
The knowledge articles in a category |
schemasmith://knowledge/{category}/{articleName} |
One knowledge article |
Template resources read from the loaded product, and table resources from the selected template. Until one is set, the resource says so and points to schemasmith_navigate_context.
Prompts provide pre-built conversation starters for common workflows such as schema reviews, migration planning, and new table creation. AI clients that support MCP prompts surface these as quick-start options. When a product is loaded, a prompt's text includes it.
| Prompt | What it starts | Arguments |
|---|---|---|
design_table |
Designing a new table with best practices for naming, columns, keys, and indexes | tableName (required), platform |
validate_schema |
Validating a SchemaSmith product for naming conventions, missing keys, and best practices | productPath |
plan_migration |
Planning a safe migration for a table change with rollback strategy | tableName (required), changeType |
review_schema |
Reviewing schema health: naming, nullability, orphaned tables, duplicate indexes | templateName |
compare_tables |
Comparing two table definitions side-by-side for structural differences | table1 and table2 (both required) |
onboard_product |
Loading and exploring a SchemaSmith product for the first time | productPath (required) |
troubleshoot_migration |
Diagnosing and resolving a failed or problematic migration | errorDescription (required) |
extract_and_scaffold |
Extracting schema from a live database and scaffolding a SchemaSmith product | platform and database (both required) |
The server also answers completion/complete for prompt arguments: table names from the selected template for tableName, table1 and table2, template names from the loaded product for templateName, change types for changeType, and platform names for platform.
The server writes its log to standard error, which most MCP clients keep in a file. Passwords and other secret-looking values are masked in every line the server writes there, at any level, the text of an error included.
The built-in patterns decide which names count as secret, along with the logHygiene block of askforge.json, which the server reads when it starts, and the same block in the loaded product's SchemaQuench.settings.json, which it reads each time schemasmith_navigate_context loads a product (or --product-path preloads one). A block it cannot use whole is reported once: in the log at start-up for askforge.json, and in the log and schemasmith_navigate_context's answer for a product's. Configuration describes the block.
To change how much the server logs, set a log level in the client's env, or pass it in args:
SCHEMASMITH_Logging__LogLevel__Default=Debug
--Logging:LogLevel:Default=Debug
An error is logged in the line itself, with:
Include Error Detail, and a PL/pgSQL RAISE can put any text in a detail or hint, as it can in the message.Left out: the SQL a driver can attach to an error (the query, and a PostgreSQL error's context, which quotes the statement a function was running), and any other data attached to an error. A message longer than 4,096 characters is cut there, and so is any one of the values above longer than 1,024. A request that is not valid JSON is logged by its length and the line and position where it stopped parsing, never its text.
When a tool fails, the error text it sends your MCP client, and so the AI model behind it, is masked the same way. Masking runs one line at a time, so a line that ends with a password does not hide the lines after it, such as the reason the tool failed or the path to its full output. A tool's successful result is sent as the tool wrote it, since it is often a script or a table the model writes back into your package, except a Deploy tool's (the schemasmith_run_ tools), which is the tool's log and is masked the same way; schemasmith_list_connections masks a secret-looking connection property itself.
One report is not the server's own: if the server cannot start at all, .NET writes that failure to standard error itself, unmasked. The server's start-up steps keep any error that could carry a secret away from that report.
Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.
The source is on GitHub for anyone to read.
Get Started on GitHub