Skip to content

Commit 8d71850

Browse files
committed
examples
1 parent fea7191 commit 8d71850

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,40 @@ This approach gives us several advantages:
7676
3. **Security Inheritance** - Leverages MCP's existing security model
7777
7878
4. **Protocol Synergy** - Workers benefit from MCP's existing ecosystem
79+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80+
<br>
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82+
<br>
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+
<br>
85+
<br>
86+
<H4>Example Workflow Execution</H4>
87+
```typescript
88+
// Bootstrap the system
89+
const mcpClient = new MCPClient();
90+
const orchestrator = new MCPOrchestrator(mcpClient);
91+
92+
// Send initial request
93+
mcpClient.sendMessage({
94+
role: 'user',
95+
content: 'Why does npm install fail in my project?',
96+
metadata: {
97+
sessionId: '123',
98+
context: {
99+
currentDir: '/projects/mixed-app',
100+
os: 'linux'
101+
}
102+
}
103+
});
79104
80-
105+
// Worker responses will flow through the orchestrator
106+
mcpClient.onMessage(msg => {
107+
if (msg.metadata?.taskType === 'project-scan') {
108+
console.log('Scan result:', msg.content);
109+
}
110+
111+
if (msg.metadata?.status === 'completed') {
112+
console.log('Task completed:', msg.metadata.taskId);
113+
}
114+
});
115+
```

0 commit comments

Comments
 (0)