Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/agents/rust-docs.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: "Use when: looking up Rust crate documentation, searching crates.io for packages, checking crate versions, reading API docs on docs.rs, or researching Rust library features and usage."
name: "rust-docs"
tools: [web]
---

You are a Rust documentation specialist. Your job is to look up accurate, up-to-date information about Rust crates and their APIs.

## Primary Sources

Use these sources:
1. **docs.rs** (`https://docs.rs/<crate>/latest/<crate>`) — Official generated API documentation for any published crate
2. **crates.io** (`https://crates.io/crates/<crate>`) — Crate metadata: latest version, downloads, links, features, dependencies
3. **Rust standard library** (`https://doc.rust-lang.org/std/`) — Documentation for `std`, `core`, and `alloc`

## Workflow

1. Fetch the relevant docs.rs page for API details, struct/trait/function signatures, and examples
2. If needed, fetch the crate's page on crates.io to get the latest version and basic metadata
3. Return distiled, precise, factual information with direct links to the pages you consulted

## Constraints

- Always include the crate version the docs apply to
- Prefer stable docs over nightly/pre-release unless the user asks otherwise
34 changes: 18 additions & 16 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Copilot Instructions for Rust MCP Server

<!-- Use this file to provide workspace-specific custom instructions to Copilot. For more details, visit https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file -->

This is a Rust implementation of a Model Context Protocol (MCP) server.

## Project Context
Expand All @@ -26,37 +24,41 @@ This is a Rust implementation of a Model Context Protocol (MCP) server.
## Dependencies
- `tokio`: Async runtime
- `serde`: Serialization/deserialization
- `rust-mcp-sdk`: MCP protocol handling
- `rmcp`: MCP protocol handling
- `anyhow`: Error handling
- `tracing`: Structured logging

## AI Agent Guidelines

### 1. Always Use Rust MCP Tools

- **DO**: Use `Rust-cargo-build` instead of direct `bash` commands like `cargo build`
- **DO**: Use `Rust-cargo-check` for quick code validation
- **DO**: Use `Rust-cargo-clippy` for linting instead of manual clippy commands
- **WHY**: MCP tools provide better defaults, structured output, and superior error handling
- Use `#cargo-check` for quick code validation
- Use `#cargo-clippy` for linting
- Use `#cargo-fmt` for code formatting
- Use `#cargo-test` for running tests

### 2. use @rust-docs subagent

- For any questions about public API for dependencies or standard library, consult the `@rust-docs` subagent. Just ask it what you looking for in natural language, and it will fetch the relevant documentation for you.

### 2. Development Workflow

Follow this systematic approach when working on code changes:

1. **Check current state**: Use `Rust-cargo-check` with `all_targets: true, all_features: true`
1. **Check current state**: Use `#cargo-check` with `all_targets: true, all_features: true`
2. **Make changes**: Edit code using appropriate development tools
3. **Validate**: Use `Rust-cargo-clippy` with `workspace: true, all_targets: true`
4. **Format**: Use `Rust-cargo-fmt` with `all: true`
5. **Test**: Use `Rust-cargo-test` with `all_features: true`
6. **Build**: Use `Rust-cargo-build` with `all_targets: true, all_features: true` for final verification
7. **Check unused dependencies**: Use `Rust-cargo-machete` to identify unused dependencies
8. **Verify security compliance**: Use `Rust-cargo-deny-check` to ensure security and licensing compliance
3. **Validate**: Use `#cargo-clippy` with `workspace: true, all_targets: true`
4. **Format**: Use `#cargo-fmt` with `all: true`
5. **Test**: Use `#cargo-test` with `all_features: true`
6. **Build**: Use `#cargo-build` with `all_targets: true, all_features: true` for final verification
7. **Check unused dependencies**: Use `#cargo-machete` to identify unused dependencies
8. **Verify security compliance**: Use `#cargo-deny-check` to ensure security and licensing compliance

### 3. Dependency Management

- When adding dependencies, prefer workspace-level dependencies in the root `Cargo.toml`
- Use `Rust-cargo-add` and `Rust-cargo-remove` for dependency management
- Regularly run `Rust-cargo-update` to keep dependencies current
- Use `#cargo-add` and `#cargo-remove` for dependency management
- Regularly run `#cargo-update` to keep dependencies current

### 4. Code Quality Standards

Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,3 @@ jobs:

- name: cargo-deny
run: cargo deny check --allow license-not-encountered

linelint:
runs-on: ubuntu-latest
name: Linelint

steps:
- uses: actions/checkout@v6
- uses: fernandrone/linelint@0.0.6
id: linelint
9 changes: 7 additions & 2 deletions .vscode/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"rust-mcp-server": {
"type": "stdio",
"command": "./tmp/rust-mcp-server.exe",
"args": ["--log-file", "./tmp/rust-mcp-server.log"],
"args": [
"--log-file",
"./tmp/rust-mcp-server.log",
"--log-level",
"debug"
],
}
}
}
}
Loading