Skip to content

Commit 2672a74

Browse files
jqnatividadclaude
andcommitted
feat(mcpb): add MCP prompts for welcome message and examples
Added two interactive prompts that users can select in Claude Desktop: 1. **Welcome Prompt** - Provides: - Introduction to qsv and its capabilities - Privacy & security assurances (100% local processing) - Quick start examples - Common commands reference - Getting started guidance 2. **Examples Prompt** - Shows: - Data exploration patterns - Data cleaning workflows - Data transformation examples - Complex multi-step pipelines - Format conversion usage How it works: - Users can select prompts from Claude Desktop's UI - Prompts appear as pre-formatted conversations - Provides onboarding for new users - Reference guide for common tasks Changes to manifest.json: - Added "prompts" array with welcome and examples prompts Changes to mcp-server.ts: - Added ListPromptsRequestSchema and GetPromptRequestSchema imports - Added "prompts" capability to server - Implemented registerPromptHandlers() method - Added handlers for prompts/list and prompts/get requests - Created rich markdown content for both prompts Updated description to clarify restricted filesystem access. Regenerated qsv-mcp-server.mcpb. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e488a84 commit 2672a74

File tree

3 files changed

+245
-0
lines changed

3 files changed

+245
-0
lines changed

.claude/skills/manifest.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@
137137
}
138138
],
139139
"tools_generated": true,
140+
"prompts": [
141+
{
142+
"name": "welcome",
143+
"description": "Welcome message and quick start guide for qsv",
144+
"arguments": []
145+
},
146+
{
147+
"name": "examples",
148+
"description": "Show common qsv usage examples",
149+
"arguments": []
150+
}
151+
],
140152
"compatibility": {
141153
"platforms": ["darwin", "win32", "linux"]
142154
},

.claude/skills/qsv-mcp-server.mcpb

2.03 KB
Binary file not shown.

.claude/skills/src/mcp-server.ts

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
ListResourcesRequestSchema,
1414
ListToolsRequestSchema,
1515
ReadResourceRequestSchema,
16+
ListPromptsRequestSchema,
17+
GetPromptRequestSchema,
1618
} from '@modelcontextprotocol/sdk/types.js';
1719

1820
import { SkillLoader } from './loader.js';
@@ -57,6 +59,7 @@ class QsvMcpServer {
5759
capabilities: {
5860
tools: {},
5961
resources: {},
62+
prompts: {},
6063
},
6164
},
6265
);
@@ -100,6 +103,11 @@ class QsvMcpServer {
100103
this.registerResourceHandlers();
101104
console.error('Resource handlers registered');
102105

106+
// Register prompt handlers
107+
console.error('About to register prompt handlers...');
108+
this.registerPromptHandlers();
109+
console.error('Prompt handlers registered');
110+
103111
console.error('QSV MCP Server initialized successfully');
104112
}
105113

@@ -414,6 +422,231 @@ class QsvMcpServer {
414422
});
415423
}
416424

425+
/**
426+
* Register prompt handlers
427+
*/
428+
private registerPromptHandlers(): void {
429+
// List prompts handler
430+
this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
431+
return {
432+
prompts: [
433+
{
434+
name: 'welcome',
435+
description: 'Welcome message and quick start guide for qsv',
436+
arguments: [],
437+
},
438+
{
439+
name: 'examples',
440+
description: 'Show common qsv usage examples',
441+
arguments: [],
442+
},
443+
],
444+
};
445+
});
446+
447+
// Get prompt handler
448+
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
449+
const { name } = request.params;
450+
451+
if (name === 'welcome') {
452+
return {
453+
messages: [
454+
{
455+
role: 'user',
456+
content: {
457+
type: 'text',
458+
text: 'Hello! Tell me about qsv and how to get started.',
459+
},
460+
},
461+
{
462+
role: 'assistant',
463+
content: {
464+
type: 'text',
465+
text: `# Welcome to qsv Data Wrangling! 🎉
466+
467+
I'm your qsv assistant, ready to help you wrangle CSV, Excel, and JSONL files with ease.
468+
469+
## What is qsv?
470+
471+
qsv is a blazingly-fast command-line toolkit with 66 commands for:
472+
- ✅ **Transforming** data (select, rename, replace, apply)
473+
- ✅ **Analyzing** data (stats, frequency, describe)
474+
- ✅ **Validating** data (schema, validate, safenames)
475+
- ✅ **Querying** data with SQL (sqlp, joinp)
476+
- ✅ **Converting** formats (Excel, JSONL, Parquet)
477+
478+
## 🔒 Privacy & Security
479+
480+
- **100% local processing** - your data never leaves your machine
481+
- **Restricted access** - only works with directories you approve
482+
- **No cloud uploads** - all operations happen on your computer
483+
484+
## Quick Start
485+
486+
**1. List your CSV files**
487+
\`\`\`
488+
List CSV files in my Downloads folder
489+
\`\`\`
490+
491+
**2. Preview a file**
492+
\`\`\`
493+
Show me the first few rows of data.csv
494+
\`\`\`
495+
496+
**3. Get statistics**
497+
\`\`\`
498+
Calculate statistics for the price column in sales.csv
499+
\`\`\`
500+
501+
**4. Filter and transform**
502+
\`\`\`
503+
From customers.csv, remove duplicates and sort by revenue
504+
\`\`\`
505+
506+
## Common Commands
507+
508+
- **qsv_stats** - Calculate statistics (sum, mean, min, max, etc.)
509+
- **qsv_frequency** - Show value distributions
510+
- **qsv_search** - Filter rows with regex patterns
511+
- **qsv_select** - Select/exclude columns
512+
- **qsv_pipeline** - Chain multiple operations
513+
514+
## Need Help?
515+
516+
- Ask "Show me qsv examples" for more usage patterns
517+
- Say "List available qsv commands" to see all 66 commands
518+
- Ask about specific operations like "How do I deduplicate a CSV?"
519+
520+
## Ready to Start?
521+
522+
Just tell me what you want to do with your data, and I'll help you use qsv to get it done!`,
523+
},
524+
},
525+
],
526+
};
527+
}
528+
529+
if (name === 'examples') {
530+
return {
531+
messages: [
532+
{
533+
role: 'user',
534+
content: {
535+
type: 'text',
536+
text: 'Show me common qsv usage examples',
537+
},
538+
},
539+
{
540+
role: 'assistant',
541+
content: {
542+
type: 'text',
543+
text: `# Common qsv Usage Examples
544+
545+
## Data Exploration
546+
547+
**Preview a CSV file:**
548+
\`\`\`
549+
Show me the first 10 rows of data.csv
550+
\`\`\`
551+
552+
**Get column statistics:**
553+
\`\`\`
554+
Calculate statistics for all columns in sales.csv
555+
\`\`\`
556+
557+
**Show value frequency:**
558+
\`\`\`
559+
Show the frequency distribution of the 'status' column in orders.csv
560+
\`\`\`
561+
562+
## Data Cleaning
563+
564+
**Remove duplicates:**
565+
\`\`\`
566+
Remove duplicate rows from customers.csv and save as cleaned.csv
567+
\`\`\`
568+
569+
**Filter rows:**
570+
\`\`\`
571+
From sales.csv, keep only rows where the price column is greater than 100
572+
\`\`\`
573+
574+
**Fix column names:**
575+
\`\`\`
576+
Make all column names in data.csv safe (remove special characters)
577+
\`\`\`
578+
579+
## Data Transformation
580+
581+
**Select columns:**
582+
\`\`\`
583+
From users.csv, select only the name, email, and city columns
584+
\`\`\`
585+
586+
**Rename columns:**
587+
\`\`\`
588+
In data.csv, rename 'old_name' to 'new_name'
589+
\`\`\`
590+
591+
**Sort data:**
592+
\`\`\`
593+
Sort sales.csv by revenue in descending order
594+
\`\`\`
595+
596+
## Complex Workflows
597+
598+
**Multi-step pipeline:**
599+
\`\`\`
600+
From customers.csv:
601+
1. Remove duplicate emails
602+
2. Keep only customers from California
603+
3. Sort by revenue descending
604+
4. Take top 100
605+
5. Save as top_customers.csv
606+
\`\`\`
607+
608+
**Join datasets:**
609+
\`\`\`
610+
Join orders.csv with customers.csv on customer_id
611+
\`\`\`
612+
613+
## Data Validation
614+
615+
**Check schema:**
616+
\`\`\`
617+
Validate sales.csv against this schema: price is number, date is date format
618+
\`\`\`
619+
620+
**Find data quality issues:**
621+
\`\`\`
622+
Check products.csv for empty values, duplicates, and invalid data
623+
\`\`\`
624+
625+
## Format Conversion
626+
627+
**Excel to CSV:**
628+
\`\`\`
629+
Convert spreadsheet.xlsx to CSV format
630+
\`\`\`
631+
632+
**CSV to JSONL:**
633+
\`\`\`
634+
Convert data.csv to JSONL format
635+
\`\`\`
636+
637+
---
638+
639+
**Try any of these patterns with your own files!** Just describe what you want to do, and I'll use qsv to make it happen.`,
640+
},
641+
},
642+
],
643+
};
644+
}
645+
646+
throw new Error(`Unknown prompt: ${name}`);
647+
});
648+
}
649+
417650
/**
418651
* Start the server
419652
*/

0 commit comments

Comments
 (0)