Skip to content

Commit 2583b0d

Browse files
Merge pull request #315 from olasunkanmi-SE/feature_connector
Feature connector
2 parents 9fedba3 + b72f83b commit 2583b0d

File tree

18 files changed

+1364
-127
lines changed

18 files changed

+1364
-127
lines changed

ROADMAP_CONNECTORS.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Connectors Feature Roadmap
2+
3+
This document outlines the roadmap for implementing the "Connectors" feature in CodeBuddy. This feature allows users to easily manage integrations with external services (like Google Drive, GitHub, etc.) which are powered by the Model Context Protocol (MCP) or internal Skills.
4+
5+
## Phase 1: Foundation & Backend Architecture
6+
7+
**Goal**: Establish the backend service to manage connectors and integrate with the existing MCP architecture.
8+
9+
### 1.1 Define Connector Data Model
10+
- Create interfaces for `Connector`, `ConnectorConfig`, and `ConnectorStatus`.
11+
- **Connector Types**:
12+
- `Built-in`: Pre-configured MCP servers (e.g., Google Drive, GitHub).
13+
- `Custom`: User-defined MCP servers.
14+
- `Skill`: Existing CodeBuddy skills (optional, for unification).
15+
16+
### 1.2 Implement `ConnectorService`
17+
- **Responsibilities**:
18+
- Registry of available connectors.
19+
- State management (Connected, Disconnected, Error).
20+
- Configuration persistence.
21+
- Interfacing with `MCPService` to start/stop servers.
22+
- **Key Methods**:
23+
- `getConnectors()`: Returns list of all connectors with status.
24+
- `connect(connectorId, config)`: Enables and starts the connector.
25+
- `disconnect(connectorId)`: Stops and disables the connector.
26+
- `saveConfig(connectorId, config)`: Updates connector settings.
27+
28+
### 1.3 MCP Service Integration
29+
- Update `MCPService` to allow dynamic addition/removal of servers via the `ConnectorService`.
30+
- Ensure `ConnectorService` can "drive" the `MCPService`.
31+
32+
## Phase 2: Frontend UI (Webview)
33+
34+
**Goal**: Create a user-friendly interface for managing connectors, matching the provided design.
35+
36+
### 2.1 Connectors View
37+
- Add a new navigation item/tab for "Connectors".
38+
- Create `ConnectorsPage` component.
39+
- Implement `ConnectorList` to display items.
40+
41+
### 2.2 Connector Item Component
42+
- Display: Icon, Name, Description (optional), Status indicator.
43+
- Actions:
44+
- **Connect/Disconnect** toggle or button.
45+
- **Configure** button (opens a modal/form).
46+
47+
### 2.3 Configuration UI
48+
- Create a generic configuration form generator based on the Connector's required config (e.g., API Keys, Env Vars).
49+
- Implement "Add Custom Connector" flow.
50+
51+
## Phase 3: Integration & "Batteries Included"
52+
53+
**Goal**: robust integration and providing useful default connectors.
54+
55+
### 3.1 Wire Frontend to Backend
56+
- Implement message passing between Webview and Extension for connector actions (`connect`, `disconnect`, `save-config`).
57+
- Real-time status updates (e.g., showing "Connecting..." spinner).
58+
59+
### 3.2 Implement Core Connectors
60+
- **GitHub**: Map to `mcp/github` or similar.
61+
- **Google Drive**: Map to `mcp/gdrive` (if available) or similar.
62+
- **Postgres**: Map to `mcp/postgres`.
63+
- **Filesystem**: Expose local FS configuration.
64+
65+
### 3.3 Testing & Validation
66+
- Verify connection flows.
67+
- specific error handling for failed connections.
68+
- Ensure persistence works across VS Code restarts.
69+
70+
## Future Enhancements
71+
- **Auth Integration**: OAuth flows for connectors that require it (vs manual token entry).
72+
- **Connector Marketplace**: Fetch available connectors from a remote registry.
73+
- **Skill Unification**: Merge existing `SkillManager` into the Connectors framework for a unified experience.

debug_mcp.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const { spawn } = require('child_process');
2+
const path = require('path');
3+
4+
const serverPath = path.join(__dirname, 'dist/MCP/server.js');
5+
console.log(`Spawning server: ${serverPath}`);
6+
7+
const server = spawn('node', [serverPath], {
8+
env: { ...process.env, CODEBUDDY_MCP_SERVER: 'true' }
9+
});
10+
11+
server.stdout.on('data', (data) => {
12+
const str = data.toString();
13+
console.log(`STDOUT: ${JSON.stringify(str)}`);
14+
// Check if it's valid JSON-RPC
15+
try {
16+
JSON.parse(str);
17+
console.log("STDOUT is valid JSON");
18+
} catch (e) {
19+
console.log("STDOUT is NOT valid JSON");
20+
}
21+
});
22+
23+
server.stderr.on('data', (data) => {
24+
console.log(`STDERR: ${data.toString()}`);
25+
});
26+
27+
server.on('close', (code) => {
28+
console.log(`Exited with code ${code}`);
29+
});
30+
31+
// Send initialize request
32+
const initRequest = {
33+
jsonrpc: '2.0',
34+
id: 1,
35+
method: 'initialize',
36+
params: {
37+
protocolVersion: '2024-11-05',
38+
capabilities: {},
39+
clientInfo: { name: 'debug-client', version: '1.0.0' }
40+
}
41+
};
42+
43+
setTimeout(() => {
44+
console.log("Sending initialize request...");
45+
server.stdin.write(JSON.stringify(initRequest) + '\n');
46+
}, 1000);
47+
48+
setTimeout(() => {
49+
console.log("Closing...");
50+
server.kill();
51+
}, 5000);

0 commit comments

Comments
 (0)