Skip to content
bitzorcas
中EN

Guide

BitzSaury migration MCP servers

Build and configure three BitzSaury migration MCP servers for foundation contracts, legacy code, and migration PRDs.

Last updated

The BitzSaury migration MCP suite is a development-time search tool under tooling/mcp-bitzsaury. It helps teams migrate Saury and BitzOrcas legacy systems onto BitzOrcasVNext by exposing foundation contracts, legacy code, and PRDs as structured MCP tools.

Runtime model

ItemCurrent implementation
Runtime.NET 10
MCP SDKModelContextProtocol 2.1.0
Transportstdio; an editor or agent launches each server as a child process
Search enginelocal rg (ripgrep)
Path configurationenvironment variables only; no developer path is hard-coded
Logging boundarystdout carries MCP JSON-RPC only; logs, ready messages, and configuration errors go to stderr
Package versionsthe subtree owns Directory.Packages.props, isolated from the product package ledger
Agent / editor
├─ bitzsaury-base → BitzOrcasVNext Framework / Platform / CONTEXT
├─ bitzsaury-legacy → Saury and BitzOrcas legacy code
└─ bitzsaury-prd → BusinessModulesPRD and LegacyPRD-BitzOrcas

Servers and environment variables

ServerDLLToolsRequired variableOptional variable
BitzSaury.Mcp.BaseContractsBitzSaury.Mcp.BaseContracts.dll5BITZSAURY_BASE_REPONone
BitzSaury.Mcp.LegacyCodeBitzSaury.Mcp.LegacyCode.dll3BITZSAURY_BITZORCAS_REPOBITZSAURY_SAURY_REPO
BitzSaury.Mcp.PrdBitzSaury.Mcp.Prd.dll4BITZSAURY_DOCS_REPONone

Each variable must point to an existing file or directory:

  • BITZSAURY_BASE_REPO: BitzOrcasVNext root containing src/Platform, src/Framework, CONTEXT.md, and architecture rules;
  • BITZSAURY_BITZORCAS_REPO: BitzOrcas legacy repository root;
  • BITZSAURY_SAURY_REPO: Saury legacy repository root. The Legacy server can search BitzOrcas alone when it is absent;
  • BITZSAURY_DOCS_REPO: knowledge-repository root containing projects/BitzSaury.Modern/BusinessModulesPRD and LegacyPRD-BitzOrcas.

If a required variable is empty or the path does not exist, startup writes CONFIG ERROR to stderr and exits non-zero. Keep absolute paths in each developer’s local MCP configuration, never in the repository.

Build

Run from the BitzOrcasVNext root:

Terminal window
# Build Core first; all three servers consume the same base assembly.
cd tooling/mcp-bitzsaury/src
dotnet build BitzSaury.Mcp.Core/BitzSaury.Mcp.Core.csproj -c Release
dotnet build BitzSaury.Mcp.BaseContracts/BitzSaury.Mcp.BaseContracts.csproj -c Release
dotnet build BitzSaury.Mcp.LegacyCode/BitzSaury.Mcp.LegacyCode.csproj -c Release
dotnet build BitzSaury.Mcp.Prd/BitzSaury.Mcp.Prd.csproj -c Release

Build Core first, followed by the three servers. DLLs are written under each project’s bin/Release/net10.0/. The runtime machine must also resolve rg from PATH.

MCP client configuration

This example uses ZCode’s mcp.json shape. Replace placeholders with local absolute paths; other stdio MCP clients can map the same command, arguments, and environment.

mcp.json
{
"mcpServers": {
"bitzsaury-base": {
"command": "dotnet",
"args": [
"<base-repo>/tooling/mcp-bitzsaury/src/BitzSaury.Mcp.BaseContracts/bin/Release/net10.0/BitzSaury.Mcp.BaseContracts.dll"
],
"env": { "BITZSAURY_BASE_REPO": "<base-repo>" }
},
"bitzsaury-legacy": {
"command": "dotnet",
"args": [
"<base-repo>/tooling/mcp-bitzsaury/src/BitzSaury.Mcp.LegacyCode/bin/Release/net10.0/BitzSaury.Mcp.LegacyCode.dll"
],
"env": {
"BITZSAURY_BITZORCAS_REPO": "<legacy-bitzorcas-repo>",
"BITZSAURY_SAURY_REPO": "<legacy-saury-repo>"
}
},
"bitzsaury-prd": {
"command": "dotnet",
"args": [
"<base-repo>/tooling/mcp-bitzsaury/src/BitzSaury.Mcp.Prd/bin/Release/net10.0/BitzSaury.Mcp.Prd.dll"
],
"env": { "BITZSAURY_DOCS_REPO": "<knowledge-repo>" }
}
}
}

After activation, a client normally prefixes tool names, for example mcp__bitzsaury-base__find_contract. The exact prefix is client-defined.

12 tools

BaseContracts: foundation contracts and red lines

ToolMain parametersReturns
find_contractquery, maxResults?Framework/Platform interfaces, aggregates, ports, and CONTEXT-MAP clues
find_aggregatename, contextLines?aggregate/entity locations and context
query_extension_pointsdomain, maxResults?Contributor, Provider, Adapter, Resolver, Hook, Store, and Port extension points
check_redlinecode, filePath?architecture-red-line and prohibited-pattern findings for submitted code
suggest_base_reuselegacyPatternreuse, extend, or build guidance with related PRD/Skill references

check_redline inspects caller-supplied text and does not edit files. suggest_base_reuse is navigation, not architecture approval; confirm its proposal against current contracts, tests, and the formal compliance audit.

LegacyCode: legacy navigation

ToolMain parametersReturns
find_legacy_entityname, project?, maxResults?Saury T_*, BitzOrcas [SugarTable], and related entity hits
find_legacy_servicename, project?, maxResults?AppService, Manage, Manager, and service hits
get_legacy_filepath, project?, maxLines?bounded content from an absolute or repository-relative path

project accepts saury, bitzorcas, or both. Do not request the Saury scope when only the BitzOrcas root is configured.

Prd: migration knowledge base

ToolMain parametersReturns
list_modulesNoneBusinessModulesPRD module number, title, and document count
query_module_prdquery, includeContent?module and Overview matches by number, name, or keyword
search_prdquery, maxResults?full-text matches across both PRD trees
read_prdpath, maxLines?bounded content from a selected PRD file
  1. Establish module scope and terminology with query_module_prd; use read_prd for the authoritative section.
  2. Build evidence for legacy behavior with find_legacy_entity, find_legacy_service, and get_legacy_file.
  3. Locate existing foundation capabilities through find_contract, find_aggregate, and query_extension_points.
  4. Use suggest_base_reuse to form a candidate, then inspect the actual contracts.
  5. After implementation, submit changed code to check_redline and run the repository’s formal architecture and merge gates.

MCP supplies a dynamic view of “what exists now.” Migration Skills supply procedural guidance for “how to transform it.” Neither replaces business acceptance.

Troubleshooting

SymptomInspect
Server exits immediatelymissing variable named in stderr; whether its path exists
Client reports invalid protocol JSONwhether any logger writes stdout; the current implementation routes Console Logger to stderr
Tool misses code that existsrg installation, repository-root variable, and search scope
Legacy search returns only one systemproject and BITZSAURY_SAURY_REPO
PRD reports a missing directoryBITZSAURY_DOCS_REPO must be the knowledge root, not the BusinessModulesPRD child
Tool behavior remains stale after source changesrebuild Release and verify the MCP configuration points to the current DLL

Source locations

  • tooling/mcp-bitzsaury/README.md
  • tooling/mcp-bitzsaury/src/BitzSaury.Mcp.Core/McpPaths.cs
  • tooling/mcp-bitzsaury/src/BitzSaury.Mcp.Core/Ripgrep.cs
  • tooling/mcp-bitzsaury/src/BitzSaury.Mcp.BaseContracts/Tools/
  • tooling/mcp-bitzsaury/src/BitzSaury.Mcp.LegacyCode/Tools/
  • tooling/mcp-bitzsaury/src/BitzSaury.Mcp.Prd/Tools/

After you locate Saury T_WorkflowDefinition* or StepBody types, hand definition migration to the Workflow Migrator source saury path. The MCP servers only search; they do not emit DSL.

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%