Skip to content

Commit f03ad13

Browse files
committed
feat: rename binary to 'codeprism' with --mcp flag for server mode
Changes made to align with documentation and user preference: Binary & CLI Changes: - Rename binary from 'codeprism-mcp-server' to 'codeprism' - Add --mcp flag to run MCP server mode: 'codeprism --mcp' - Default behavior shows usage and suggests MCP mode - CLI help now shows 'codeprism' as command name Infrastructure Updates: - Update release workflow to build 'codeprism' binary - Update Dockerfile to use 'codeprism' binary and CMD ['codeprism', '--mcp'] - Update all binary artifact names in CI/CD pipeline - Keep crate name as 'codeprism-mcp-server' for publishing User Experience: - Matches documentation expectations: {'command': 'codeprism', 'args': ['--mcp']} - Cleaner binary name without redundant 'mcp-server' suffix - Extensible for future non-MCP modes (CLI analysis, etc.) - All tests passing with new binary structure This aligns the actual binary with the documented interface in Claude Desktop configuration examples.
1 parent cf0bcc1 commit f03ad13

File tree

4 files changed

+43
-25
lines changed

4 files changed

+43
-25
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ jobs:
167167
if: matrix.target == 'x86_64-unknown-linux-musl'
168168
run: sudo apt-get install -y musl-tools
169169

170-
- name: Build CodePrism MCP Server Binary
171-
run: cargo build --release --target ${{ matrix.target }} --bin codeprism-mcp-server
170+
- name: Build CodePrism Binary
171+
run: cargo build --release --target ${{ matrix.target }} --bin codeprism
172172

173173
- name: Build Moth Test Harness Binary
174174
run: cargo build --release --target ${{ matrix.target }} --bin moth
175175

176176
- name: Prepare Binaries (Unix)
177177
if: matrix.os != 'windows-latest'
178178
run: |
179-
# CodePrism MCP Server
180-
cp target/${{ matrix.target }}/release/codeprism-mcp-server codeprism-mcp-server-${{ matrix.suffix }}
181-
chmod +x codeprism-mcp-server-${{ matrix.suffix }}
179+
# CodePrism Binary
180+
cp target/${{ matrix.target }}/release/codeprism codeprism-${{ matrix.suffix }}
181+
chmod +x codeprism-${{ matrix.suffix }}
182182
183183
# Moth Test Harness
184184
cp target/${{ matrix.target }}/release/moth moth-${{ matrix.suffix }}
@@ -188,17 +188,17 @@ jobs:
188188
if: matrix.os == 'windows-latest'
189189
shell: pwsh
190190
run: |
191-
# CodePrism MCP Server
192-
Copy-Item "target/${{ matrix.target }}/release/codeprism-mcp-server.exe" "codeprism-mcp-server-${{ matrix.suffix }}"
191+
# CodePrism Binary
192+
Copy-Item "target/${{ matrix.target }}/release/codeprism.exe" "codeprism-${{ matrix.suffix }}"
193193
194194
# Moth Test Harness
195195
Copy-Item "target/${{ matrix.target }}/release/moth.exe" "moth-${{ matrix.suffix }}"
196196
197-
- name: Upload CodePrism MCP Server Binary
197+
- name: Upload CodePrism Binary
198198
uses: actions/upload-artifact@v4
199199
with:
200-
name: codeprism-mcp-server-${{ matrix.suffix }}
201-
path: codeprism-mcp-server-${{ matrix.suffix }}
200+
name: codeprism-${{ matrix.suffix }}
201+
path: codeprism-${{ matrix.suffix }}
202202
retention-days: 5
203203

204204
- name: Upload Moth Test Harness Binary
@@ -262,8 +262,8 @@ jobs:
262262
run: |
263263
mkdir -p release-assets
264264
265-
# Copy CodePrism MCP Server binaries
266-
find binaries -type f \( -name "codeprism-mcp-server-*" \) | while read file; do
265+
# Copy CodePrism binaries
266+
find binaries -type f \( -name "codeprism-*" \) | while read file; do
267267
cp "$file" release-assets/
268268
done
269269

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ RUN if [ -n "$CRATE_VERSION" ]; then \
2222
else \
2323
echo "Building from source (CI/development)" && \
2424
cd /tmp/source && \
25-
cargo build --release --bin codeprism-mcp-server && \
26-
cp target/release/codeprism-mcp-server /usr/local/cargo/bin/; \
25+
cargo build --release --bin codeprism && \
26+
cp target/release/codeprism /usr/local/cargo/bin/; \
2727
fi
2828

2929
# Runtime stage
@@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y \
3636
&& useradd -r -s /bin/false codeprism
3737

3838
# Copy the binary from cargo install location
39-
COPY --from=builder /usr/local/cargo/bin/codeprism-mcp-server /usr/local/bin/codeprism-mcp-server
39+
COPY --from=builder /usr/local/cargo/bin/codeprism /usr/local/bin/codeprism
4040

4141
# Create workspace directory
4242
RUN mkdir -p /workspace && chown codeprism:codeprism /workspace
@@ -56,10 +56,10 @@ ENV REPOSITORY_PATH=/workspace
5656

5757
# Health check
5858
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
59-
CMD codeprism-mcp-server --help || exit 1
59+
CMD codeprism --help || exit 1
6060

61-
# Default command
62-
CMD ["codeprism-mcp-server"]
61+
# Default command - run as MCP server
62+
CMD ["codeprism", "--mcp"]
6363

6464
# Labels for metadata
6565
LABEL org.opencontainers.image.title="CodePrism MCP Server"

crates/codeprism-mcp-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["mcp", "server", "code-analysis", "rust-sdk"]
1111
categories = ["development-tools", "network-programming"]
1212

1313
[[bin]]
14-
name = "codeprism-mcp-server"
14+
name = "codeprism"
1515
path = "src/main.rs"
1616

1717
[dependencies]

crates/codeprism-mcp-server/src/main.rs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ use codeprism_mcp_server::{CodePrismMcpServer, Config};
99
use tracing::{info, level_filters::LevelFilter};
1010
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
1111

12-
/// CodePrism MCP Server - Expose code analysis capabilities via MCP protocol
12+
/// CodePrism - Code analysis and insights tool
1313
#[derive(Parser, Debug)]
1414
#[command(
15-
name = "codeprism-mcp-server",
15+
name = "codeprism",
1616
version = codeprism_mcp_server::VERSION,
17-
about = "CodePrism MCP Server - Code analysis via Model Context Protocol"
17+
about = "CodePrism - Advanced code analysis and insights"
1818
)]
1919
struct Cli {
20+
/// Run as MCP (Model Context Protocol) server
21+
#[arg(long)]
22+
mcp: bool,
23+
2024
/// Configuration file path
2125
#[arg(short, long, value_name = "FILE")]
2226
config: Option<String>,
@@ -56,9 +60,23 @@ async fn main() -> Result<()> {
5660
return Ok(());
5761
}
5862

59-
// Create and run the MCP server
60-
let server = CodePrismMcpServer::new(config).await?;
61-
server.run().await?;
63+
// Check what mode to run in
64+
if cli.mcp {
65+
// Run as MCP server
66+
info!("Starting MCP server mode");
67+
let server = CodePrismMcpServer::new(config).await?;
68+
server.run().await?;
69+
} else {
70+
// Show usage information when no mode is specified
71+
println!("CodePrism v{}", codeprism_mcp_server::VERSION);
72+
println!("Advanced code analysis and insights");
73+
println!();
74+
println!("For Claude Desktop integration, use:");
75+
println!(" codeprism --mcp");
76+
println!();
77+
println!("For help:");
78+
println!(" codeprism --help");
79+
}
6280

6381
Ok(())
6482
}

0 commit comments

Comments
 (0)