Skip to content

Commit a0dd7ee

Browse files
committed
MCP Enhancements
1 parent e28112e commit a0dd7ee

38 files changed

+402
-1417
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Superagentic AI
3+
Copyright (c) 2025 Superagentic AI
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/advanced/mcp-integration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ Create a module that searches the web and summarizes results
126126

127127
DSPy Code generates code with MCP integration!
128128

129+
---
130+
131+
## 🧪 Real-World MCP Recipes
132+
133+
Looking for concrete, copy-pasteable workflows? Start with these:
134+
135+
- 📂 **Project Files Assistant (Filesystem MCP)**
136+
Turn your local project into a browsable, explainable knowledge base.
137+
See: [MCP Filesystem Assistant](../tutorials/mcp-filesystem-assistant.md)
138+
139+
- 🐙 **GitHub Triage Copilot (GitHub MCP)**
140+
Pull issues/PRs via MCP and generate a morning triage summary.
141+
See: [MCP GitHub Triage Copilot](../tutorials/mcp-github-triage.md)
142+
143+
---
144+
129145
## MCP Server Types
130146

131147
### 1. stdio Transport

docs/reference/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Add an MCP server configuration.
239239

240240
**Examples:**
241241
```
242-
/mcp-add filesystem --transport stdio --command uvx --args mcp-server-filesystem
242+
/mcp-add filesystem --transport stdio --command npx --args -y "@modelcontextprotocol/server-filesystem" /path/to/directory
243243
/mcp-add github --transport sse --url https://api.github.com/mcp
244244
```
245245

docs/reference/configuration.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ models:
4141
mcp_servers:
4242
- name: filesystem
4343
transport: stdio
44-
command: uvx
44+
command: npx
4545
args:
46-
- mcp-server-filesystem
46+
- -y
47+
- "@modelcontextprotocol/server-filesystem"
48+
- /path/to/root
4749
env:
48-
- name: MCP_SERVER_FILESYSTEM_ROOT
49-
value: /path/to/root
50+
- name: NODE_ENV
51+
value: production
5052

5153
rag:
5254
enabled: true
@@ -197,12 +199,14 @@ List of MCP server configurations.
197199
```yaml
198200
- name: filesystem
199201
transport: stdio
200-
command: uvx
202+
command: npx
201203
args:
202-
- mcp-server-filesystem
204+
- -y
205+
- "@modelcontextprotocol/server-filesystem"
206+
- /path/to/root
203207
env:
204-
- name: MCP_SERVER_FILESYSTEM_ROOT
205-
value: /path/to/root
208+
- name: NODE_ENV
209+
value: production
206210
```
207211

208212
#### sse (Server-Sent Events)

dspy_code/commands/config_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def show_config(verbose: bool = False) -> None:
2929
config_manager = ConfigManager()
3030
if not config_manager.is_project_initialized():
3131
console.print("[red]Error:[/red] Not in a DSPy project directory.")
32-
console.print("Run 'dspy-cli init' to initialize a new project.")
32+
console.print("Run 'dspy-code init' to initialize a new project.")
3333
return
3434

3535
try:
@@ -150,7 +150,7 @@ def reset_config(skip_confirmation: bool = False, verbose: bool = False) -> None
150150
config_manager = ConfigManager()
151151
if not config_manager.is_project_initialized():
152152
console.print("[red]Error:[/red] Not in a DSPy project directory.")
153-
console.print("Run 'dspy-cli init' to initialize a new project.")
153+
console.print("Run 'dspy-code init' to initialize a new project.")
154154
return
155155

156156
try:
@@ -184,7 +184,7 @@ def reset_config(skip_confirmation: bool = False, verbose: bool = False) -> None
184184
" Edit dspy_config.yaml or run '/connect <provider> <model>' in interactive mode"
185185
)
186186
console.print("\n2. View configuration:")
187-
console.print(" [cyan]dspy-cli config show[/cyan]")
187+
console.print(" [cyan]dspy-code config show[/cyan]")
188188

189189
except Exception as e:
190190
logger.error(f"Failed to reset configuration: {e}")

dspy_code/commands/create_command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def execute(
4848
config_manager = ConfigManager()
4949
if not config_manager.is_project_initialized():
5050
console.print("[red]Error:[/red] No dspy_config.yaml found in current directory.")
51-
console.print("Run 'dspy-cli init' to create a configuration file.")
51+
console.print("Run 'dspy-code init' to create a configuration file.")
5252
return
5353

5454
try:
@@ -245,10 +245,10 @@ def _show_next_steps(output_file: Path) -> None:
245245
"""Show next steps to the user."""
246246
console.print("\n[bold]Next Steps:[/bold]")
247247
console.print("1. Test your component:")
248-
console.print(f" [cyan]dspy-cli run {output_file} --interactive[/cyan]")
248+
console.print(f" [cyan]dspy-code run {output_file} --interactive[/cyan]")
249249
console.print("\n2. Optimize performance:")
250-
console.print(f" [cyan]dspy-cli optimize {output_file}[/cyan]")
250+
console.print(f" [cyan]dspy-code optimize {output_file}[/cyan]")
251251
console.print("\n3. Export for sharing:")
252-
console.print(f" [cyan]dspy-cli export {output_file}[/cyan]")
252+
console.print(f" [cyan]dspy-code export {output_file}[/cyan]")
253253
console.print("\n4. View the generated code:")
254254
console.print(f" [cyan]cat {output_file}[/cyan]")

dspy_code/commands/export_command.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def execute(
4444
config_manager = ConfigManager()
4545
if not config_manager.is_project_initialized():
4646
console.print("[red]Error:[/red] No dspy_config.yaml found in current directory.")
47-
console.print("Run 'dspy-cli init' to create a configuration file.")
47+
console.print("Run 'dspy-code init' to create a configuration file.")
4848
return
4949

5050
try:
@@ -105,10 +105,10 @@ def _export_as_json(
105105
# Create export data
106106
export_data = {
107107
"export_info": {
108-
"format": "dspy-cli-json",
108+
"format": "dspy-code-json",
109109
"version": "1.0",
110110
"exported_at": datetime.now().isoformat(),
111-
"exported_by": "dspy-cli",
111+
"exported_by": "dspy-code",
112112
},
113113
"component": {
114114
"name": component_file.stem,
@@ -312,7 +312,7 @@ def _create_export_readme(
312312
313313
This component was created using DSPy Code, a command-line interface for the DSPy framework.
314314
315-
- Learn more: https://github.com/dspy-cli/dspy-cli
315+
- Learn more: https://github.com/dspy-code/dspy-code
316316
- DSPy Documentation: https://dspy-docs.vercel.app/
317317
318318
## Export Information
@@ -346,7 +346,7 @@ def _show_sharing_instructions(output_file: Path, export_format: str) -> None:
346346
if export_format == "json":
347347
console.print("1. Share the JSON file with others")
348348
console.print("2. Recipients can import with:")
349-
console.print(" [cyan]dspy-cli import component.json[/cyan]")
349+
console.print(" [cyan]dspy-code import component.json[/cyan]")
350350
else:
351351
console.print("1. Share the ZIP file with others")
352352
console.print("2. Recipients can extract and use:")

dspy_code/commands/init_command.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _create_minimal_project(
119119
Create a minimal DSPy project with only the configuration file.
120120
121121
This is the default initialization mode that creates only what's necessary
122-
to start using dspy-cli. Additional directories will be created on-demand
122+
to start using dspy-code. Additional directories will be created on-demand
123123
when commands need them.
124124
125125
Args:
@@ -314,17 +314,17 @@ def _create_example_files(project_dir: Path) -> None:
314314
315315
1. Create your first DSPy component:
316316
```bash
317-
dspy-cli create
317+
dspy-code create
318318
```
319319
320320
2. Test your component:
321321
```bash
322-
dspy-cli run generated/your_program.py --interactive
322+
dspy-code run generated/your_program.py --interactive
323323
```
324324
325325
3. Optimize your component:
326326
```bash
327-
dspy-cli optimize generated/your_program.py
327+
dspy-code optimize generated/your_program.py
328328
```
329329
330330
## Project Structure
@@ -343,7 +343,7 @@ def _create_example_files(project_dir: Path) -> None:
343343
## Learn More
344344
345345
- [DSPy Documentation](https://dspy-docs.vercel.app/)
346-
- [DSPy Code Guide](https://github.com/dspy-cli/dspy-cli)
346+
- [DSPy Code Guide](https://github.com/dspy-code/dspy-code)
347347
"""
348348

349349
(project_dir / "README.md").write_text(readme_content)
@@ -534,10 +534,10 @@ def _show_next_steps(project_name: str, fresh: bool = False) -> None:
534534
console.print(" [dim]See dspy_config_example.yaml for all available options[/dim]")
535535

536536
console.print("\n2. Create your first DSPy component:")
537-
console.print(" [cyan]dspy-cli create[/cyan]")
537+
console.print(" [cyan]dspy-code create[/cyan]")
538538

539539
console.print("\n3. Test model connectivity:")
540-
console.print(" [cyan]dspy-cli models test <model-name>[/cyan]")
540+
console.print(" [cyan]dspy-code models test <model-name>[/cyan]")
541541

542542
if fresh:
543543
console.print("\n4. Explore the project structure:")
@@ -547,4 +547,4 @@ def _show_next_steps(project_name: str, fresh: bool = False) -> None:
547547
console.print(" - generated/ - DSPy Code generated components")
548548

549549
console.print("\n4. Learn more:" if not fresh else "\n5. Learn more:")
550-
console.print(" [cyan]dspy-cli --help[/cyan]")
550+
console.print(" [cyan]dspy-code --help[/cyan]")

dspy_code/commands/mcp_command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ async def add_server_async(
132132

133133
console.print(f"[green]✓[/green] Server '{name}' added successfully")
134134
console.print("\nNext steps:")
135-
console.print(f" 1. Connect to the server: [cyan]dspy-cli mcp connect {name}[/cyan]")
136-
console.print(f" 2. List available tools: [cyan]dspy-cli mcp tools {name}[/cyan]")
135+
console.print(f" 1. Connect to the server: [cyan]dspy-code mcp connect {name}[/cyan]")
136+
console.print(f" 2. List available tools: [cyan]dspy-code mcp tools {name}[/cyan]")
137137

138138
except MCPError as e:
139139
console.print(f"[red]{format_mcp_error(e, verbose)}[/red]")
@@ -180,7 +180,7 @@ async def list_servers_async(verbose: bool) -> None:
180180

181181
if not servers:
182182
console.print("[yellow]No MCP servers configured[/yellow]")
183-
console.print("\nAdd a server with: [cyan]dspy-cli mcp add[/cyan]")
183+
console.print("\nAdd a server with: [cyan]dspy-code mcp add[/cyan]")
184184
return
185185

186186
display_server_table(servers)
@@ -228,7 +228,7 @@ async def connect_server_async(name: str, verbose: bool) -> None:
228228
if caps.get("prompts"):
229229
console.print(" • Prompts")
230230

231-
console.print(f"\nTry: [cyan]dspy-cli mcp tools {name}[/cyan]")
231+
console.print(f"\nTry: [cyan]dspy-code mcp tools {name}[/cyan]")
232232

233233
except MCPError as e:
234234
console.print(f"[red]{format_mcp_error(e, verbose)}[/red]")

dspy_code/commands/models_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def list_models(verbose: bool = False) -> None:
5454
config_manager = ConfigManager()
5555
if not config_manager.is_project_initialized():
5656
console.print("[red]Error:[/red] Not in a DSPy project directory.")
57-
console.print("Run 'dspy-cli init' to initialize a new project.")
57+
console.print("Run 'dspy-code init' to initialize a new project.")
5858
return
5959

6060
try:
@@ -126,7 +126,7 @@ def test_model(model_name: str, verbose: bool = False) -> None:
126126
config_manager = ConfigManager()
127127
if not config_manager.is_project_initialized():
128128
console.print("[red]Error:[/red] Not in a DSPy project directory.")
129-
console.print("Run 'dspy-cli init' to initialize a new project.")
129+
console.print("Run 'dspy-code init' to initialize a new project.")
130130
return
131131

132132
try:
@@ -170,7 +170,7 @@ def set_default_model(model_name: str, verbose: bool = False) -> None:
170170
config_manager = ConfigManager()
171171
if not config_manager.is_project_initialized():
172172
console.print("[red]Error:[/red] Not in a DSPy project directory.")
173-
console.print("Run 'dspy-cli init' to initialize a new project.")
173+
console.print("Run 'dspy-code init' to initialize a new project.")
174174
return
175175

176176
try:

0 commit comments

Comments
 (0)