Bob Demo MCP Server
# Bob Demo MCP Server
A comprehensive MCP (Model Context Protocol) server that demonstrates Bob's capabilities through 9 specialized tools for file operations, code analysis, and git operations.
## Features
### š File Operations (3 tools)
- **list_directory** - Browse project files and folders with optional recursive listing
- **read_file_content** - Read files with line numbers and optional line range selection
- **search_in_files** - Search across multiple files using regex patterns with context
### š Code Analysis (3 tools)
- **analyze_project_structure** - Get comprehensive project insights including file types, technologies, and structure
- **find_code_definitions** - Find functions, classes, methods, and interfaces in code
- **analyze_code_complexity** - Measure code metrics including lines, functions, and complexity
### š Git Operations (3 tools)
- **get_git_diff** - View changes and diffs with statistics
- **get_repository_info** - Get repository status, branch info, and commit details
- **analyze_commit_history** - Analyze commit patterns and contributor statistics
## Installation
```bash
# Install dependencies
npm install
# Build the server
npm run build
```
## Usage
This server is designed to be used with Bob AI Assistant through the MCP protocol. Once configured in Bob's MCP settings, the tools will be automatically available.
### Configuration
Add to Bob's MCP settings (`~/.bob/settings/mcp_settings.json`):
```json
{
"mcpServers": {
"bob-demo": {
"command": "node",
"args": ["/Users/ahmedchaudhry/Documents/IBM Bob/MCP/bob-demo-server/build/index.js"],
"disabled": false,
"alwaysAllow": [],
"disabledTools": []
}
}
}
```
## Example Usage
Once configured, you can ask Bob naturally:
- "List all files in the current directory"
- "Analyze this project's structure"
- "Find all TODO comments in the code"
- "Show me what I've changed in git"
- "What functions are defined in this file?"
- "How complex is this code?"
Bob will automatically use the appropriate tools to answer your questions.
## Development
```bash
# Watch mode for development
npm run watch
# Build
npm run build
```
## Architecture
```
bob-demo-server/
āāā src/
ā āāā index.ts # Main server entry point
ā āāā tools/
ā ā āāā file-operations.ts # File operation tools
ā ā āāā code-analysis.ts # Code analysis tools
ā ā āāā git-operations.ts # Git operation tools
ā āāā utils/
ā āāā file-utils.ts # File system utilities
ā āāā git-utils.ts # Git command utilities
ā āāā parser-utils.ts # Code parsing utilities
āāā build/ # Compiled JavaScript output
āāā package.json
āāā tsconfig.json
āāā README.md
```
## Requirements
- Node.js 18 or higher
- Git (for git operation tools)
- TypeScript 5.3 or higher
## License
MIT
## Author
Bob AI AssistantTDQS
Scored across 9 tools
Tools have distinct names covering different aspects (analysis, navigation, file operations), but lack descriptions could cause some ambiguity between similar-sounding tools like analyze_code_complexity and analyze_project_structure.
All tools follow a consistent verb_noun pattern with snake_case (e.g., analyze_code_complexity, get_repository_info, list_directory). No mixed conventions.
9 tools is well-scoped for a code analysis server, covering analysis, navigation, file reading, and searching without being overwhelming.
The set covers common code analysis tasks (complexity, history, structure, definitions, diff, file operations). Minor gaps like missing metadata or branch comparison, but overall sufficient for the inferred domain.