Skip to content

Commit f04e892

Browse files
committed
ready for creates
1 parent a5e9d2d commit f04e892

6 files changed

Lines changed: 407 additions & 210 deletions

File tree

mcp-rust-server/Cargo.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@
22
name = "mcp-rust-server"
33
version = "0.1.0"
44
edition = "2021"
5-
authors = ["Lishuai Jing <lishuai@syncable.dev>, Alex Holmberg<axth@syncable.dev>"]
5+
authors = [
6+
"Lishuai Jing <lishuai@syncable.dev>",
7+
"Alex Holmberg <axth@syncable.dev>",
8+
]
69
description = "High-performance Model Context Protocol (MCP) server for code analysis, security scanning, and project insights."
710
license = "MIT"
811
repository = "https://github.com/syncable-dev/syncable-cli-mcp-server"
12+
homepage = "https://github.com/syncable-dev/syncable-cli-mcp-server"
13+
documentation = "https://docs.rs/mcp-rust-server"
914
readme = "README.md"
1015

16+
# crates.io discoverability
1117
keywords = [
12-
"mcp",
13-
"mcp-server",
14-
"AI-agents",
15-
"cli",
16-
"infrastructure",
17-
"devops",
18+
"mcp", "mcp-server", "AI-agents", "cli",
19+
"devops", "infrastructure", "security", "analysis",
20+
"scan", "automation", "rust"
21+
]
22+
categories = [
23+
"command-line-utilities",
24+
"network-programming",
1825
"security",
19-
"analysis",
20-
"scan",
21-
"automation",
22-
"rust"
26+
"web-programming",
27+
"infrastructure"
2328
]
2429

2530
[dependencies]
26-
# MCP server dependencies
2731
async-trait = "0.1.88"
2832
rust-mcp-sdk = "0.4.3"
2933
tracing = "0.1.41"
30-
tracing-subscriber = { version = "0.3.19", features = ["fmt","env-filter"] }
34+
tracing-subscriber = { version = "0.3.19", features = ["fmt", "env-filter"] }
3135
serde = { version = "1.0", features = ["derive"] }
3236
serde_json = "1.0"
3337
tokio = { version = "1", features = ["full"] }
@@ -57,4 +61,3 @@ opt-level = 3
5761
lto = true
5862
codegen-units = 1
5963
panic = "abort"
60-

mcp-rust-server/README.md

Lines changed: 113 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,162 @@
1-
# 🦀 MCP Rust Server
1+
# mcp-rust-server
22

3-
> High-performance Model Context Protocol (MCP) server for code analysis, security scanning, and project insights.
3+
[![Crates.io](https://img.shields.io/crates/v/mcp-rust-server.svg?style=for-the-badge)](https://crates.io/crates/mcp-rust-server)
4+
[![Docs.rs](https://img.shields.io/docsrs/mcp-rust-server?style=for-the-badge)](https://docs.rs/mcp-rust-server)
5+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE)
46

5-
[![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/)
6-
[![Crates.io](https://img.shields.io/crates/v/mcp-rust-server?style=for-the-badge)](https://crates.io/crates/mcp-rust-server)
7-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../LICENSE)
7+
High-performance **Model Context Protocol** (MCP) server for code analysis, security scanning, and project insights—written in Rust 🦀.
88

99
---
1010

11-
## ✨ Features
11+
## Table of Contents
1212

13-
- **Fast & Scalable**: Built with async Rust for maximum performance
14-
- **Flexible Protocols**: Supports both stdio and SSE communication
15-
- **Security & Vulnerability Scanning**: Analyze codebases for risks and vulnerabilities
16-
- **Extensible**: Add new handlers and endpoints easily
17-
- **Production Ready**: Optimized release profile and logging
13+
* [Features](#features)
14+
* [Installation](#installation)
15+
16+
* [CLI Binaries](#cli-binaries)
17+
* [Library](#library)
18+
* [Usage](#usage)
19+
* [Examples](#examples)
20+
* [Documentation](#documentation)
21+
* [Contributing](#contributing)
22+
* [License](#license)
23+
* [Acknowledgments](#acknowledgments)
1824

1925
---
2026

21-
## 🚀 Quick Start
27+
## Features
2228

23-
### Build
29+
* **Fast & Scalable**: Built with async Rust on the Tokio runtime
30+
* **Multi-Protocol**: Supports both stdio and SSE (Server-Sent Events) transports
31+
* **Security Scanning**: Static analysis and vulnerability detection
32+
* **Extensible**: Easily add new MCP handlers and custom tools
33+
* **Production-Ready**: Optimized release profile, structured logging, and CI integration
2434

25-
```bash
26-
cargo build --release
27-
```
35+
---
2836

29-
### Run (Stdio Mode)
37+
## Installation
38+
39+
mcp-rust-server is published on [crates.io]. You need a recent Rust toolchain (1.70+ recommended).
40+
41+
### CLI Binaries
3042

3143
```bash
32-
cargo run --release --bin mcp-stdio
44+
cargo install mcp-rust-server
3345
```
3446

35-
### Run (SSE Mode)
47+
This installs two binaries into your Cargo `bin` directory (usually `~/.cargo/bin`):
3648

37-
```bash
38-
cargo run --release --bin mcp-sse
49+
* `mcp-stdio` — stdin/stdout-based MCP server
50+
* `mcp-sse` — HTTP/SSE-based MCP server
51+
52+
### Library
53+
54+
Add to your project’s `Cargo.toml`:
55+
56+
```toml
57+
[dependencies]
58+
mcp-rust-server = "0.1.0"
3959
```
4060

4161
---
4262

43-
## 📦 Installation (from crates.io)
63+
## Usage
64+
65+
### CLI Binaries
4466

4567
```bash
46-
cargo install mcp-rust-server
68+
# Run the stdio-based server
69+
mcp-stdio
70+
71+
# Run the SSE-based server
72+
mcp-sse
73+
```
74+
75+
By default, both servers will:
76+
77+
1. Read framed MCP requests (JSON-RPC) from the chosen transport
78+
2. Dispatch to your registered handlers
79+
3. Write framed MCP responses
80+
81+
### Library
82+
83+
```rust
84+
use mcp_rust_server::{start_stdio, start_sse};
85+
86+
#[tokio::main]
87+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
88+
// Run as a stdio server
89+
start_stdio().await?;
90+
91+
// Or run as an HTTP/SSE server
92+
// start_sse().await?;
93+
94+
Ok(())
95+
}
4796
```
4897

98+
* `start_stdio()` initializes logging, registers tools, and listens on stdin/stdout.
99+
* `start_sse()` spins up an HTTP server at `http://0.0.0.0:8000/mcp` and streams MCP responses.
100+
49101
---
50102

51-
## 🛠️ Usage
103+
## Examples
104+
105+
See the \[`examples/`] directory for full end-to-end demos:
52106

53-
- Use as a standalone server for MCP protocol
54-
- Integrate with Syncable CLI or other tools
55-
- Communicate via stdio or SSE endpoints
107+
* `examples/stdio_client.rs` — launch `mcp-stdio` and send sample requests
108+
* `examples/sse_client.html` — web page that connects to `mcp-sse` and renders events
56109

57110
---
58111

59-
## 🧪 Testing
112+
## Documentation
113+
114+
Full API documentation is generated on [docs.rs]:
60115

61116
```bash
62-
cargo test
117+
cargo doc --open
63118
```
64119

120+
Or browse online:
121+
[https://docs.rs/mcp-rust-server](https://docs.rs/mcp-rust-server)
122+
65123
---
66124

67-
## 📄 License
125+
## Contributing
68126

69-
MIT License - see [LICENSE](../LICENSE) for details.
127+
Contributions are welcome! Please:
70128

71-
---
129+
1. Fork the repo
130+
2. Create a feature branch (`git checkout -b feat/your-feature`)
131+
3. Commit your changes (`git commit -m "Add feature"`)
132+
4. Push to your fork (`git push origin feat/your-feature`)
133+
5. Open a pull request
72134

73-
## 🤝 Contributing
135+
Run tests and lint before submitting:
74136

75-
Contributions are welcome! Please open issues or pull requests for improvements.
137+
```bash
138+
cargo test
139+
cargo fmt -- --check
140+
cargo clippy -- -D warnings
141+
```
76142

77143
---
78144

79-
## 📚 Documentation
145+
## License
80146

81-
- See the main project [README](../README.md) for integration and usage examples.
82-
- API docs: Run `cargo doc --open`
147+
Licensed under the [MIT License]. See \[LICENSE] for details.
83148

84149
---
85150

86-
## Ref
87-
- [Rust-mcp-sdk](https://lib.rs/crates/rust-mcp-sdk)
88-
- [Release tool](https://github.com/release-plz/release-plz)
151+
## Acknowledgments
152+
153+
* Built on top of the [rust-mcp-sdk]
154+
* Inspired by the [Syncable CLI MCP Server]
155+
* Thanks to the Rust community and all contributors
89156

90-
**Built with Rust 🦀 and the open-source community.**
157+
[crates.io]: https://crates.io/crates/mcp-rust-server
158+
[docs.rs]: https://docs.rs/mcp-rust-server
159+
[examples/]: https://github.com/syncable-dev/syncable-cli-mcp-server/tree/main/examples
160+
[MIT License]: LICENSE
161+
[rust-mcp-sdk]: https://crates.io/crates/rust-mcp-sdk
162+
[Syncable CLI MCP Server]: https://github.com/syncable-dev/syncable-cli-mcp-server

0 commit comments

Comments
 (0)