@tecet/ollm 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/cli.js +20 -14
  2. package/dist/cli.js.map +3 -3
  3. package/dist/services/documentService.d.ts.map +1 -1
  4. package/dist/services/documentService.js +12 -2
  5. package/dist/services/documentService.js.map +1 -1
  6. package/dist/ui/components/docs/DocsPanel.d.ts.map +1 -1
  7. package/dist/ui/components/docs/DocsPanel.js +1 -1
  8. package/dist/ui/components/docs/DocsPanel.js.map +1 -1
  9. package/dist/ui/components/launch/VersionBanner.js +1 -1
  10. package/dist/ui/components/launch/VersionBanner.js.map +1 -1
  11. package/dist/ui/components/layout/KeybindsLegend.d.ts.map +1 -1
  12. package/dist/ui/components/layout/KeybindsLegend.js +1 -1
  13. package/dist/ui/components/layout/KeybindsLegend.js.map +1 -1
  14. package/dist/ui/components/tabs/BugReportTab.js +1 -1
  15. package/dist/ui/components/tabs/BugReportTab.js.map +1 -1
  16. package/dist/ui/services/docsService.d.ts +12 -27
  17. package/dist/ui/services/docsService.d.ts.map +1 -1
  18. package/dist/ui/services/docsService.js +40 -67
  19. package/dist/ui/services/docsService.js.map +1 -1
  20. package/docs/README.md +3 -410
  21. package/package.json +10 -7
  22. package/scripts/copy-docs-to-user.cjs +34 -0
  23. package/docs/Context/CheckpointFlowDiagram.md +0 -673
  24. package/docs/Context/ContextArchitecture.md +0 -898
  25. package/docs/Context/ContextCompression.md +0 -1102
  26. package/docs/Context/ContextManagment.md +0 -750
  27. package/docs/Context/Index.md +0 -209
  28. package/docs/Context/README.md +0 -390
  29. package/docs/DevelopmentRoadmap/Index.md +0 -238
  30. package/docs/DevelopmentRoadmap/OLLM-CLI_Releases.md +0 -419
  31. package/docs/DevelopmentRoadmap/PlanedFeatures.md +0 -448
  32. package/docs/DevelopmentRoadmap/README.md +0 -174
  33. package/docs/DevelopmentRoadmap/Roadmap.md +0 -572
  34. package/docs/DevelopmentRoadmap/RoadmapVisual.md +0 -372
  35. package/docs/Hooks/Architecture.md +0 -885
  36. package/docs/Hooks/Index.md +0 -244
  37. package/docs/Hooks/KeyboardShortcuts.md +0 -248
  38. package/docs/Hooks/Protocol.md +0 -817
  39. package/docs/Hooks/README.md +0 -403
  40. package/docs/Hooks/UserGuide.md +0 -1483
  41. package/docs/Hooks/VisualGuide.md +0 -598
  42. package/docs/Index.md +0 -506
  43. package/docs/Installation.md +0 -586
  44. package/docs/Introduction.md +0 -367
  45. package/docs/LLM Models/Index.md +0 -239
  46. package/docs/LLM Models/LLM_GettingStarted.md +0 -748
  47. package/docs/LLM Models/LLM_Index.md +0 -701
  48. package/docs/LLM Models/LLM_MemorySystem.md +0 -337
  49. package/docs/LLM Models/LLM_ModelCompatibility.md +0 -499
  50. package/docs/LLM Models/LLM_ModelsArchitecture.md +0 -933
  51. package/docs/LLM Models/LLM_ModelsCommands.md +0 -839
  52. package/docs/LLM Models/LLM_ModelsConfiguration.md +0 -1094
  53. package/docs/LLM Models/LLM_ModelsList.md +0 -1071
  54. package/docs/LLM Models/LLM_ModelsList.md.backup +0 -400
  55. package/docs/LLM Models/README.md +0 -355
  56. package/docs/MCP/MCP_Architecture.md +0 -1086
  57. package/docs/MCP/MCP_Commands.md +0 -1111
  58. package/docs/MCP/MCP_GettingStarted.md +0 -590
  59. package/docs/MCP/MCP_Index.md +0 -524
  60. package/docs/MCP/MCP_Integration.md +0 -866
  61. package/docs/MCP/MCP_Marketplace.md +0 -160
  62. package/docs/MCP/README.md +0 -415
  63. package/docs/Prompts System/Architecture.md +0 -760
  64. package/docs/Prompts System/Index.md +0 -223
  65. package/docs/Prompts System/PromptsRouting.md +0 -1047
  66. package/docs/Prompts System/PromptsTemplates.md +0 -1102
  67. package/docs/Prompts System/README.md +0 -389
  68. package/docs/Prompts System/SystemPrompts.md +0 -856
  69. package/docs/Quickstart.md +0 -535
  70. package/docs/Tools/Architecture.md +0 -884
  71. package/docs/Tools/GettingStarted.md +0 -624
  72. package/docs/Tools/Index.md +0 -216
  73. package/docs/Tools/ManifestReference.md +0 -141
  74. package/docs/Tools/README.md +0 -440
  75. package/docs/Tools/UserGuide.md +0 -773
  76. package/docs/Troubleshooting.md +0 -1265
  77. package/docs/UI&Settings/Architecture.md +0 -729
  78. package/docs/UI&Settings/ColorASCII.md +0 -34
  79. package/docs/UI&Settings/Commands.md +0 -755
  80. package/docs/UI&Settings/Configuration.md +0 -872
  81. package/docs/UI&Settings/Index.md +0 -293
  82. package/docs/UI&Settings/Keybinds.md +0 -372
  83. package/docs/UI&Settings/README.md +0 -278
  84. package/docs/UI&Settings/Terminal.md +0 -637
  85. package/docs/UI&Settings/Themes.md +0 -604
  86. package/docs/UI&Settings/UIGuide.md +0 -550
@@ -1,866 +0,0 @@
1
- # MCP Integration Guide
2
-
3
- **Practical Guide to Integrating MCP Servers with OLLM CLI**
4
-
5
- ---
6
-
7
- ## Table of Contents
8
-
9
- 1. [Introduction](#introduction)
10
- 2. [Prerequisites](#prerequisites)
11
- 3. [Quick Start](#quick-start)
12
- 4. [Configuration](#configuration)
13
- 5. [Using MCP Tools](#using-mcp-tools)
14
- 6. [OAuth Authentication](#oauth-authentication)
15
- 7. [Health Monitoring](#health-monitoring)
16
- 8. [Troubleshooting](#troubleshooting)
17
- 9. [Best Practices](#best-practices)
18
-
19
- ---
20
-
21
- ## Introduction
22
-
23
- This guide walks you through integrating MCP (Model Context Protocol) servers with OLLM CLI. By the end, you'll be able to:
24
-
25
- - Configure and start MCP servers
26
- - Discover and use external tools
27
- - Set up OAuth authentication
28
- - Monitor server health
29
- - Troubleshoot common issues
30
-
31
- ### What is MCP?
32
-
33
- MCP (Model Context Protocol) is a standard protocol that allows AI assistants to connect to external data sources and tools. It enables:
34
-
35
- - **Tool Integration**: Access external APIs and services
36
- - **Resource Access**: Read files, databases, and other resources
37
- - **Prompt Templates**: Use pre-defined prompts
38
- - **Secure Authentication**: OAuth 2.0 support
39
-
40
- ---
41
-
42
- ## Prerequisites
43
-
44
- ### System Requirements
45
-
46
- - Node.js 20+ installed
47
- - OLLM CLI installed and configured
48
- - Internet connection (for remote MCP servers)
49
-
50
- ### Optional Requirements
51
-
52
- - OAuth credentials (for secure servers)
53
- - MCP server packages (for local servers)
54
-
55
- ---
56
-
57
- ## Quick Start
58
-
59
- ### 1. Install an MCP Server
60
-
61
- Let's start with a simple example using the GitHub MCP server:
62
-
63
- ```bash
64
- # Install the GitHub MCP server globally
65
- npm install -g @modelcontextprotocol/server-github
66
- ```
67
-
68
- ### 2. Configure the Server
69
-
70
- Create or edit your OLLM configuration file:
71
-
72
- **Location:** `~/.ollm/config.yaml` or `.ollm/config.yaml`
73
-
74
- ```yaml
75
- mcp:
76
- enabled: true
77
- connectionTimeout: 10000
78
- servers:
79
- github:
80
- command: 'npx'
81
- args: ['-y', '@modelcontextprotocol/server-github']
82
- env:
83
- GITHUB_TOKEN: '${GITHUB_TOKEN}'
84
- transport: 'stdio'
85
- ```
86
-
87
- ### 3. Set Environment Variable
88
-
89
- ```bash
90
- # Set your GitHub token
91
- export GITHUB_TOKEN='your_github_token_here'
92
- ```
93
-
94
- ### 4. Start OLLM CLI
95
-
96
- ```bash
97
- ollm
98
- ```
99
-
100
- The GitHub MCP server will start automatically, and its tools will be available to the agent.
101
-
102
- ### 5. Use MCP Tools
103
-
104
- In the OLLM CLI, you can now use GitHub tools:
105
-
106
- ```
107
- > Create an issue in my repo about the bug we discussed
108
-
109
- The agent will use the `github_create_issue` tool automatically.
110
- ```
111
-
112
- ---
113
-
114
- ## Configuration
115
-
116
- ### Configuration File Structure
117
-
118
- ```yaml
119
- mcp:
120
- # Enable/disable MCP integration
121
- enabled: true
122
-
123
- # Connection timeout in milliseconds
124
- connectionTimeout: 10000
125
-
126
- # MCP servers configuration
127
- servers:
128
- # Server name (can be anything)
129
- server-name:
130
- # Command to start the server
131
- command: 'node'
132
-
133
- # Command arguments
134
- args: ['path/to/server.js']
135
-
136
- # Environment variables
137
- env:
138
- API_KEY: '${API_KEY}'
139
- DEBUG: 'true'
140
-
141
- # Transport type: stdio, sse, or http
142
- transport: 'stdio'
143
-
144
- # Optional: Connection timeout override
145
- timeout: 15000
146
- ```
147
-
148
- ### Transport Types
149
-
150
- #### Stdio Transport (Recommended)
151
-
152
- Best for local MCP servers running as child processes.
153
-
154
- ```yaml
155
- servers:
156
- local-server:
157
- command: 'node'
158
- args: ['server.js']
159
- transport: 'stdio'
160
- ```
161
-
162
- **Pros:**
163
-
164
- - Fast and efficient
165
- - No network overhead
166
- - Easy to debug
167
-
168
- **Cons:**
169
-
170
- - Only works for local servers
171
- - Requires server executable
172
-
173
- #### SSE Transport
174
-
175
- Best for remote MCP servers with long-lived connections.
176
-
177
- ```yaml
178
- servers:
179
- remote-server:
180
- command: 'https://api.example.com/mcp'
181
- transport: 'sse'
182
- env:
183
- AUTHORIZATION: 'Bearer ${API_TOKEN}'
184
- ```
185
-
186
- **Pros:**
187
-
188
- - Works with remote servers
189
- - Real-time updates
190
- - Efficient for streaming
191
-
192
- **Cons:**
193
-
194
- - Requires server support
195
- - Network dependent
196
-
197
- #### HTTP Transport
198
-
199
- Best for simple remote MCP servers.
200
-
201
- ```yaml
202
- servers:
203
- api-server:
204
- command: 'https://api.example.com/mcp'
205
- transport: 'http'
206
- env:
207
- API_KEY: '${API_KEY}'
208
- ```
209
-
210
- **Pros:**
211
-
212
- - Simple and universal
213
- - Works with any HTTP server
214
- - Easy to implement
215
-
216
- **Cons:**
217
-
218
- - Higher latency
219
- - No streaming support
220
- - More network overhead
221
-
222
- ### Environment Variable Substitution
223
-
224
- Use `${VAR_NAME}` syntax to reference environment variables:
225
-
226
- ```yaml
227
- servers:
228
- github:
229
- env:
230
- GITHUB_TOKEN: '${GITHUB_TOKEN}'
231
- GITHUB_ORG: '${GITHUB_ORG}'
232
- DEBUG: 'true' # Literal value
233
- ```
234
-
235
- **Rules:**
236
-
237
- - Variables are substituted from parent process environment
238
- - Missing variables log a warning and use empty string
239
- - Literal values don't need substitution syntax
240
-
241
- ---
242
-
243
- ## Using MCP Tools
244
-
245
- ### Discovering Available Tools
246
-
247
- Use the `/mcp` command to list servers and tools:
248
-
249
- ```bash
250
- # List all MCP servers
251
- /mcp
252
-
253
- # List tools from a specific server
254
- /mcp tools github
255
- ```
256
-
257
- **Output:**
258
-
259
- ```
260
- 3 tool(s) from 'github':
261
-
262
- 1. github_create_issue
263
- Create a new issue in a repository
264
- Input schema: {
265
- "repo": "string (required)",
266
- "title": "string (required)",
267
- "body": "string (optional)"
268
- }
269
-
270
- 2. github_list_issues
271
- List issues in a repository
272
- ...
273
- ```
274
-
275
- ### Using Tools in Conversation
276
-
277
- The agent will automatically use MCP tools when appropriate:
278
-
279
- ```
280
- User: Create an issue titled "Fix login bug" in my repo
281
-
282
- Agent: I'll create that issue for you.
283
- [Uses github_create_issue tool]
284
- ✓ Issue created: #123
285
- ```
286
-
287
- ### Manual Tool Invocation
288
-
289
- You can also invoke tools manually (advanced):
290
-
291
- ```typescript
292
- const result = await mcpClient.callTool('github', 'github_create_issue', {
293
- repo: 'owner/repo',
294
- title: 'Fix login bug',
295
- body: 'Description of the bug',
296
- });
297
- ```
298
-
299
- ### Tool Call Timeout
300
-
301
- Default timeout: 30 seconds (configurable)
302
-
303
- ```yaml
304
- mcp:
305
- servers:
306
- slow-server:
307
- command: 'node'
308
- args: ['server.js']
309
- timeout: 60000 # 60 seconds
310
- ```
311
-
312
- ---
313
-
314
- ## OAuth Authentication
315
-
316
- ### When to Use OAuth
317
-
318
- OAuth is required for MCP servers that access protected resources:
319
-
320
- - GitHub (private repositories)
321
- - Google Workspace (Gmail, Drive, Calendar)
322
- - Slack (private channels)
323
- - Other authenticated APIs
324
-
325
- ### OAuth Configuration
326
-
327
- #### 1. Configure OAuth in Manifest
328
-
329
- If using an extension:
330
-
331
- ```json
332
- {
333
- "name": "github-extension",
334
- "mcpServers": {
335
- "github": {
336
- "command": "npx",
337
- "args": ["-y", "@modelcontextprotocol/server-github"],
338
- "oauth": {
339
- "enabled": true,
340
- "authorizationUrl": "https://github.com/login/oauth/authorize",
341
- "tokenUrl": "https://github.com/login/oauth/access_token",
342
- "scopes": ["repo", "user"]
343
- }
344
- }
345
- }
346
- }
347
- ```
348
-
349
- #### 2. Start OAuth Flow
350
-
351
- ```bash
352
- # Check OAuth status
353
- /mcp oauth status github
354
-
355
- # Start OAuth login
356
- /mcp oauth login github
357
- ```
358
-
359
- **What Happens:**
360
-
361
- 1. Browser opens to authorization page
362
- 2. You authorize the application
363
- 3. Token is stored securely
364
- 4. Server can now access protected resources
365
-
366
- #### 3. Token Storage
367
-
368
- Tokens are stored securely:
369
-
370
- **Primary:** Platform keychain
371
-
372
- - Windows: Credential Manager
373
- - macOS: Keychain
374
- - Linux: Secret Service API
375
-
376
- **Fallback:** Encrypted file
377
-
378
- - Location: `~/.ollm/oauth-tokens.json`
379
- - Encryption: AES-256-GCM
380
- - Permissions: User-only read/write
381
-
382
- #### 4. Token Refresh
383
-
384
- Tokens are automatically refreshed before expiration:
385
-
386
- ```typescript
387
- // Automatic refresh (no user action needed)
388
- if (token.expiresAt < Date.now() + 300000) {
389
- // 5 minutes before expiry
390
- await oauthProvider.refreshToken(serverName);
391
- }
392
- ```
393
-
394
- #### 5. Token Revocation
395
-
396
- ```bash
397
- # Revoke OAuth token
398
- /mcp oauth revoke github
399
-
400
- # This will:
401
- # - Remove token from storage
402
- # - Revoke token with provider (if supported)
403
- # - Require re-authentication
404
- ```
405
-
406
- ### OAuth Troubleshooting
407
-
408
- **Problem:** Browser doesn't open
409
-
410
- **Solution:**
411
-
412
- ```bash
413
- # Manually open the URL shown in the terminal
414
- # Copy the authorization code from the callback URL
415
- ```
416
-
417
- **Problem:** Token expired
418
-
419
- **Solution:**
420
-
421
- ```bash
422
- # Tokens refresh automatically
423
- # If refresh fails, re-authenticate:
424
- /mcp oauth login github
425
- ```
426
-
427
- **Problem:** Permission denied
428
-
429
- **Solution:**
430
-
431
- ```bash
432
- # Check required scopes in manifest
433
- # Re-authenticate with correct scopes:
434
- /mcp oauth revoke github
435
- /mcp oauth login github
436
- ```
437
-
438
- ---
439
-
440
- ## Health Monitoring
441
-
442
- ### Automatic Health Checks
443
-
444
- OLLM CLI automatically monitors MCP server health:
445
-
446
- - **Check Interval:** 30 seconds (configurable)
447
- - **Auto-Restart:** Up to 3 attempts
448
- - **Exponential Backoff:** 1s, 2s, 4s
449
-
450
- ### Health Commands
451
-
452
- ```bash
453
- # Check health of all servers
454
- /mcp health
455
-
456
- # Check specific server
457
- /mcp health check github
458
-
459
- # Manually restart a server
460
- /mcp restart github
461
-
462
- # Start automatic monitoring
463
- /mcp health start
464
-
465
- # Stop automatic monitoring
466
- /mcp health stop
467
-
468
- # Check monitoring status
469
- /mcp health status
470
- ```
471
-
472
- ### Health States
473
-
474
- - **✅ Healthy:** Server responding normally
475
- - **⚠️ Degraded:** Server slow or intermittent
476
- - **❌ Failed:** Server not responding
477
- - **🔄 Restarting:** Attempting to restart
478
-
479
- ### Configuration
480
-
481
- ```yaml
482
- mcpHealth:
483
- enabled: true
484
- checkInterval: 30000 # 30 seconds
485
- maxRestartAttempts: 3
486
- autoRestart: true
487
- ```
488
-
489
- ### Health Events
490
-
491
- You can listen to health events via hooks:
492
-
493
- ```json
494
- {
495
- "hooks": {
496
- "notification": [
497
- {
498
- "name": "health-alert",
499
- "command": "node",
500
- "args": ["hooks/health-alert.js"]
501
- }
502
- ]
503
- }
504
- }
505
- ```
506
-
507
- **Hook Input:**
508
-
509
- ```json
510
- {
511
- "event": "notification",
512
- "data": {
513
- "type": "mcp_health",
514
- "server": "github",
515
- "status": "failed",
516
- "error": "Connection timeout"
517
- }
518
- }
519
- ```
520
-
521
- ---
522
-
523
- ## Troubleshooting
524
-
525
- ### Common Issues
526
-
527
- #### 1. Server Won't Start
528
-
529
- **Symptoms:**
530
-
531
- ```
532
- ❌ Failed to start MCP server 'github'
533
- Error: Command not found: npx
534
- ```
535
-
536
- **Solutions:**
537
-
538
- - Verify command is in PATH: `which npx`
539
- - Install required package: `npm install -g npx`
540
- - Use absolute path: `command: '/usr/local/bin/npx'`
541
- - Check permissions: `chmod +x /path/to/server`
542
-
543
- #### 2. Connection Timeout
544
-
545
- **Symptoms:**
546
-
547
- ```
548
- ❌ MCP server 'github' connection timeout
549
- ```
550
-
551
- **Solutions:**
552
-
553
- - Increase timeout in configuration:
554
- ```yaml
555
- mcp:
556
- connectionTimeout: 30000 # 30 seconds
557
- ```
558
- - Check server logs for errors
559
- - Verify network connectivity (for remote servers)
560
- - Try manual server start to debug
561
-
562
- #### 3. Tools Not Appearing
563
-
564
- **Symptoms:**
565
-
566
- - Server starts successfully
567
- - No tools available in `/mcp tools`
568
-
569
- **Solutions:**
570
-
571
- - Check server status: `/mcp status github`
572
- - Verify server implements `tools/list`
573
- - Check server logs for errors
574
- - Restart server: `/mcp restart github`
575
-
576
- #### 4. OAuth Failures
577
-
578
- **Symptoms:**
579
-
580
- ```
581
- ❌ OAuth authentication failed
582
- Error: Invalid client credentials
583
- ```
584
-
585
- **Solutions:**
586
-
587
- - Verify OAuth configuration in manifest
588
- - Check client ID and secret
589
- - Ensure redirect URI is correct
590
- - Check required scopes
591
- - Re-authenticate: `/mcp oauth login github`
592
-
593
- #### 5. Permission Denied
594
-
595
- **Symptoms:**
596
-
597
- ```
598
- ❌ Permission denied: filesystem access
599
- Path: /path/to/file
600
- ```
601
-
602
- **Solutions:**
603
-
604
- - Check extension permissions in manifest
605
- - Grant permission when prompted
606
- - Verify file/directory exists
607
- - Check file permissions: `ls -la /path/to/file`
608
-
609
- ### Debug Mode
610
-
611
- Enable debug logging:
612
-
613
- ```yaml
614
- mcp:
615
- debug: true
616
- ```
617
-
618
- Or via environment variable:
619
-
620
- ```bash
621
- export OLLM_LOG_LEVEL=debug
622
- ollm
623
- ```
624
-
625
- ### Viewing Logs
626
-
627
- ```bash
628
- # View MCP client logs
629
- tail -f ~/.ollm/logs/mcp-client.log
630
-
631
- # View server logs (stdio transport)
632
- tail -f ~/.ollm/logs/mcp-server-github.log
633
- ```
634
-
635
- ### Testing Servers Manually
636
-
637
- Test an MCP server outside of OLLM CLI:
638
-
639
- ```bash
640
- # Start server manually
641
- npx -y @modelcontextprotocol/server-github
642
-
643
- # Send test request (in another terminal)
644
- echo '{"method":"tools/list"}' | npx -y @modelcontextprotocol/server-github
645
- ```
646
-
647
- ---
648
-
649
- ## Best Practices
650
-
651
- ### 1. Configuration Management
652
-
653
- **✅ Do:**
654
-
655
- - Use environment variables for secrets
656
- - Keep configuration in version control (without secrets)
657
- - Document required environment variables
658
- - Use workspace-specific configuration for projects
659
-
660
- **❌ Don't:**
661
-
662
- - Hardcode API keys in configuration
663
- - Commit secrets to version control
664
- - Use same configuration for all projects
665
-
666
- ### 2. Error Handling
667
-
668
- **✅ Do:**
669
-
670
- - Enable health monitoring
671
- - Set appropriate timeouts
672
- - Handle tool failures gracefully
673
- - Log errors for debugging
674
-
675
- **❌ Don't:**
676
-
677
- - Ignore connection failures
678
- - Use infinite timeouts
679
- - Crash on tool errors
680
-
681
- ### 3. Security
682
-
683
- **✅ Do:**
684
-
685
- - Use OAuth for authenticated servers
686
- - Store tokens securely (keychain)
687
- - Revoke tokens when no longer needed
688
- - Review extension permissions
689
-
690
- **❌ Don't:**
691
-
692
- - Share OAuth tokens
693
- - Store tokens in plain text
694
- - Grant unnecessary permissions
695
- - Trust all extensions
696
-
697
- ### 4. Performance
698
-
699
- **✅ Do:**
700
-
701
- - Use stdio transport for local servers
702
- - Enable connection pooling
703
- - Set reasonable timeouts
704
- - Monitor server health
705
-
706
- **❌ Don't:**
707
-
708
- - Use HTTP for local servers
709
- - Create new connections for each call
710
- - Use very long timeouts
711
- - Ignore performance issues
712
-
713
- ### 5. Development
714
-
715
- **✅ Do:**
716
-
717
- - Test servers independently first
718
- - Use debug mode during development
719
- - Enable hot-reload for extensions
720
- - Write comprehensive error messages
721
-
722
- **❌ Don't:**
723
-
724
- - Test only in production
725
- - Ignore debug output
726
- - Restart CLI for every change
727
- - Use generic error messages
728
-
729
- ---
730
-
731
- ## Examples
732
-
733
- ### Example 1: GitHub Integration
734
-
735
- **Configuration:**
736
-
737
- ```yaml
738
- mcp:
739
- enabled: true
740
- servers:
741
- github:
742
- command: 'npx'
743
- args: ['-y', '@modelcontextprotocol/server-github']
744
- env:
745
- GITHUB_TOKEN: '${GITHUB_TOKEN}'
746
- transport: 'stdio'
747
- ```
748
-
749
- **Usage:**
750
-
751
- ```
752
- > List issues in my repo
753
-
754
- Agent uses github_list_issues tool
755
-
756
- > Create an issue about the login bug
757
-
758
- Agent uses github_create_issue tool
759
- ```
760
-
761
- ### Example 2: Custom API Server
762
-
763
- **Configuration:**
764
-
765
- ```yaml
766
- mcp:
767
- enabled: true
768
- servers:
769
- my-api:
770
- command: 'https://api.mycompany.com/mcp'
771
- transport: 'http'
772
- env:
773
- API_KEY: '${MY_API_KEY}'
774
- ```
775
-
776
- **Usage:**
777
-
778
- ```
779
- > Query customer data for ID 12345
780
-
781
- Agent uses my-api tools
782
- ```
783
-
784
- ### Example 3: Local Python Server
785
-
786
- **Configuration:**
787
-
788
- ```yaml
789
- mcp:
790
- enabled: true
791
- servers:
792
- python-tools:
793
- command: 'python'
794
- args: ['mcp-server.py']
795
- transport: 'stdio'
796
- env:
797
- PYTHONPATH: '${PWD}/lib'
798
- ```
799
-
800
- **Server (mcp-server.py):**
801
-
802
- ```python
803
- import sys
804
- import json
805
-
806
- def handle_request(request):
807
- if request['method'] == 'tools/list':
808
- return {
809
- 'tools': [
810
- {
811
- 'name': 'calculate',
812
- 'description': 'Perform calculations',
813
- 'inputSchema': {
814
- 'type': 'object',
815
- 'properties': {
816
- 'expression': {'type': 'string'}
817
- }
818
- }
819
- }
820
- ]
821
- }
822
- # Handle other methods...
823
-
824
- # Read from stdin, write to stdout
825
- for line in sys.stdin:
826
- request = json.loads(line)
827
- response = handle_request(request)
828
- print(json.dumps(response))
829
- sys.stdout.flush()
830
- ```
831
-
832
- ---
833
-
834
- ## Next Steps
835
-
836
- - [MCP Commands Reference](MCP_commands.md) - Complete command documentation
837
- - [Hook System Guide](3%20projects/OLLM%20CLI/Hooks/README.md) - Learn about hooks
838
- - [Extension Development](3%20projects/OLLM%20CLI/Extensions/README.md) - Create your own extensions
839
- - [MCP Architecture](MCP_architecture.md) - Deep dive into architecture
840
-
841
- ---
842
-
843
- ## Support
844
-
845
- ### Getting Help
846
-
847
- - Check [Troubleshooting](#troubleshooting) section
848
- - Review MCP Specification (https://spec.modelcontextprotocol.io/)
849
- - Search existing issues on GitHub
850
- - Ask in community forums
851
-
852
- ### Reporting Issues
853
-
854
- When reporting MCP issues, include:
855
-
856
- 1. OLLM CLI version: `ollm --version`
857
- 2. MCP server name and version
858
- 3. Configuration (redact secrets)
859
- 4. Error messages and logs
860
- 5. Steps to reproduce
861
-
862
- ---
863
-
864
- **Document Version:** 1.0
865
- **Last Updated:** 2026-01-16
866
- **Status:** ✅ Complete