Skip to content

Commit 3767c93

Browse files
committed
mcp: Remove Model Context Protocol support
Delete the entire MCP server implementation including: - cli/src/services/mcp.rs (stdio server, Smart Cache service layer) - Smart Cache database bootstrap, migration, and file caching - MCP configuration files (.mcp.json, mcp.pkl) - All MCP-related context documentation
1 parent 4e4126e commit 3767c93

40 files changed

Lines changed: 89 additions & 2900 deletions

.opencode/opencode.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,5 @@
22
"$schema": "https://opencode.ai/config.json",
33
"plugin": [
44
"./plugins/sce-bash-policy.js"
5-
],
6-
"mcp": {
7-
"sce": {
8-
"type": "local",
9-
"command": ["sce", "mcp"],
10-
"enabled": true
11-
}
12-
}
5+
]
136
}

.opencode/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@opencode-ai/plugin": "1.2.27"
4+
}
5+
}

cli/Cargo.lock

Lines changed: 0 additions & 137 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ serde_json = "1"
2626
sha2 = "0.10"
2727
tokio = { version = "1", default-features = false, features = ["rt", "io-util"] }
2828
tracing = "0.1"
29-
rmcp = { version = "1", features = ["server", "transport-io"] }
30-
schemars = "1"
3129
tracing-opentelemetry = "0.29"
3230
tracing-subscriber = { version = "0.3", features = ["registry"] }
3331
turso = "0"

cli/src/app.rs

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ enum Command {
110110
Config(services::config::ConfigSubcommand),
111111
Setup(services::setup::SetupRequest),
112112
Doctor(services::doctor::DoctorRequest),
113-
Mcp,
114113
Hooks(services::hooks::HookSubcommand),
115114
Trace(services::trace::TraceRequest),
116115
Sync(services::sync::SyncRequest),
@@ -127,7 +126,6 @@ impl Command {
127126
Self::Config(_) => services::config::NAME,
128127
Self::Setup(_) => services::setup::NAME,
129128
Self::Doctor(_) => services::doctor::NAME,
130-
Self::Mcp => services::mcp::NAME,
131129
Self::Hooks(_) => services::hooks::NAME,
132130
Self::Trace(_) => services::trace::NAME,
133131
Self::Sync(_) => services::sync::NAME,
@@ -185,6 +183,10 @@ fn write_stdout_payload<W>(writer: &mut W, payload: &str) -> Result<(), Classifi
185183
where
186184
W: Write,
187185
{
186+
if payload.is_empty() {
187+
return Ok(());
188+
}
189+
188190
writeln!(writer, "{payload}").map_err(|error| {
189191
ClassifiedError::runtime(format!("Failed to write command output to stdout: {error}"))
190192
})
@@ -268,7 +270,7 @@ where
268270
&[("command", command.name())],
269271
);
270272

271-
match dispatch(&command) {
273+
match dispatch(&command, &logger) {
272274
Ok(payload) => {
273275
logger.info(
274276
"sce.command.completed",
@@ -469,7 +471,6 @@ fn convert_clap_command(command: cli_schema::Commands) -> Result<Command, Classi
469471
},
470472
format: convert_output_format(format),
471473
})),
472-
cli_schema::Commands::Mcp => Ok(Command::Mcp),
473474
cli_schema::Commands::Hooks { subcommand } => convert_hooks_subcommand(subcommand),
474475
cli_schema::Commands::Trace { subcommand } => convert_trace_subcommand(subcommand),
475476
cli_schema::Commands::Sync { format } => Ok(Command::Sync(services::sync::SyncRequest {
@@ -654,7 +655,10 @@ fn convert_trace_subcommand(
654655
}
655656
}
656657

657-
fn dispatch(command: &Command) -> Result<String, ClassifiedError> {
658+
fn dispatch(
659+
command: &Command,
660+
_logger: &services::observability::Logger,
661+
) -> Result<String, ClassifiedError> {
658662
match command {
659663
Command::Help => Ok(command_surface::help_text()),
660664
Command::HelpText { text, .. } => Ok(text.clone()),
@@ -716,8 +720,6 @@ fn dispatch(command: &Command) -> Result<String, ClassifiedError> {
716720
}
717721
Command::Doctor(request) => services::doctor::run_doctor(*request)
718722
.map_err(|error| ClassifiedError::runtime(error.to_string())),
719-
Command::Mcp => services::mcp::run_mcp_server_blocking()
720-
.map_err(|error| ClassifiedError::runtime(error.to_string())),
721723
Command::Hooks(subcommand) => services::hooks::run_hooks_subcommand(subcommand.clone())
722724
.map_err(|error| ClassifiedError::runtime(error.to_string())),
723725
Command::Trace(request) => services::trace::run_trace_subcommand(request.clone())
@@ -839,6 +841,15 @@ mod tests {
839841
assert!(stderr.contains("Try:"));
840842
}
841843

844+
#[test]
845+
fn empty_payload_does_not_write_stdout() {
846+
let mut stdout = Vec::new();
847+
848+
super::write_stdout_payload(&mut stdout, "").expect("empty payload should be skipped");
849+
850+
assert!(stdout.is_empty());
851+
}
852+
842853
#[test]
843854
fn parse_failure_stderr_contract_is_exact_and_deterministic() {
844855
let mut first_stdout = Vec::new();
@@ -1265,10 +1276,10 @@ mod tests {
12651276
}
12661277

12671278
#[test]
1268-
fn parser_routes_mcp() {
1269-
let command = parse_command(vec!["sce".to_string(), "mcp".to_string()])
1270-
.expect("command should parse");
1271-
assert_eq!(command, Command::Mcp);
1279+
fn parser_rejects_mcp() {
1280+
let error = parse_command(vec!["sce".to_string(), "mcp".to_string()])
1281+
.expect_err("mcp should be rejected");
1282+
assert!(error.to_string().contains("Unknown command 'mcp'"));
12721283
}
12731284

12741285
#[test]

cli/src/cli_schema.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ pub enum Commands {
9595
format: OutputFormat,
9696
},
9797

98-
#[command(about = "Host MCP Smart Cache Engine server for cache-aware file reads")]
99-
Mcp,
100-
10198
#[command(about = "Run git-hook runtime entrypoints for local Agent Trace flows")]
10299
Hooks {
103100
#[command(subcommand)]
@@ -830,15 +827,6 @@ mod tests {
830827
}
831828
}
832829

833-
#[test]
834-
fn parse_mcp() {
835-
let cli = Cli::try_parse_from(["sce", "mcp"]).expect("mcp should parse");
836-
match cli.command {
837-
Some(Commands::Mcp) => {}
838-
_ => panic!("Expected Mcp command"),
839-
}
840-
}
841-
842830
#[test]
843831
fn parse_completion_bash() {
844832
let cli = Cli::try_parse_from(["sce", "completion", "--shell", "bash"])

cli/src/command_surface.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ pub const COMMANDS: &[CommandContract] = &[
3939
status: ImplementationStatus::Implemented,
4040
purpose: "Authenticate with WorkOS and inspect local auth state",
4141
},
42-
CommandContract {
43-
name: services::mcp::NAME,
44-
status: ImplementationStatus::Implemented,
45-
purpose: "Host MCP Smart Cache Engine server for cache-aware file reads",
46-
},
4742
CommandContract {
4843
name: services::hooks::NAME,
4944
status: ImplementationStatus::Implemented,
@@ -97,14 +92,13 @@ Setup usage:\n sce setup [--opencode|--claude|--both] [--non-interactive] [--ho
9792
Doctor usage:\n sce doctor [--fix] [--all-databases] [--format <text|json>]\n\n\
9893
Auth usage:\n sce auth <login|logout|status> [--format <text|json>]\n\n\
9994
Completion usage:\n sce completion --shell <bash|zsh|fish>\n\n\
100-
MCP usage:\n sce mcp\n\n\
10195
Trace usage:\n sce trace prompts <commit-sha> [--format <text|json>|--json]\n\n\
10296
Output format contract:\n Supported commands accept --format <text|json>\n\n\
10397
Examples:\n sce setup\n sce setup --opencode --non-interactive --hooks\n sce setup --hooks --repo ../demo-repo\n sce auth status\n sce auth login --format json\n sce trace prompts abc1234\n sce trace prompts abc1234 --json\n sce doctor --format json\n sce doctor --all-databases --format json\n sce doctor --fix\n sce version --format json\n\n\
10498
Commands:\n{command_rows}\n\n\
10599
Setup defaults to interactive target selection when no setup target flag is passed, and installs hooks in the same run.\n\
106100
Use '--hooks' to install required git hooks for the current repository or '--repo <path>' for a specific repository.\n\
107-
`setup`, `doctor`, `auth`, `hooks`, `trace`, `mcp`, `version`, and `completion` are implemented; `sync` remains placeholder-oriented.\n"
101+
`setup`, `doctor`, `auth`, `hooks`, `trace`, `version`, and `completion` are implemented; `sync` remains placeholder-oriented.\n"
108102
)
109103
}
110104

cli/src/services/completion.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ mod tests {
7777
assert!(output.contains("config"));
7878
assert!(output.contains("setup"));
7979
assert!(output.contains("doctor"));
80-
assert!(output.contains("mcp"));
8180
assert!(output.contains("hooks"));
8281
assert!(output.contains("sync"));
8382
assert!(output.contains("version"));

0 commit comments

Comments
 (0)