File size: 3,715 Bytes
5301c48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# mcp_hackathon

# Data Generation Server for ICD Code Finetuning

This MCP server provides tools for finetuning models to improve medical ICD-10 code prediction accuracy.

## Overview

The Data Generation Server is a Model Control Protocol (MCP) server that facilitates:

1. **Model Probing**: Evaluating model performance on ICD-10 code prediction
2. **Synthetic Data Generation**: Creating training data for model finetuning

## Set up the server

```
{
  "mcpServers": {
      "data_gen_server": {
          "command": "<base_dir>/.local/bin/uv",
          "args": [
              "--directory",
              "<base_dir>/mcp_hackathon/data_gen_server",
              "run",
              "data_gen_server.py"
          ]
      }
  }
}
```

To use MCP tools in Cursor, you need to have your MCP server configured and running. Here's how to use them:

## 1. Verify MCP Configuration

First, make sure your MCP configuration is set up correctly in `/Users/john/.cursor/mcp.json`:
Read file: /Users/john/.cursor/mcp.json
Great! You have two MCP servers configured. Here's how to use them:

## 2. How MCP Tools Work in Cursor

MCP tools in Cursor work through **function calling**. When you mention or request something that can be handled by your MCP tools, Cursor will automatically:

1. **Detect** when a task matches available MCP tools
2. **Call** the appropriate tool with the right parameters
3. **Present** the results to you

## 3. Using MCP Tools

### Method 1: Direct Requests
You can directly ask me to use the tools by mentioning what you want to do:

**Examples:**
- "List all available data generation templates"
- "Generate city information for San Francisco, New York, and Los Angeles"
- "Run the starfish template with this data: [your data]"
- "Generate synthetic data for ICD codes"

### Method 2: Specific Tool References
You can reference tools by name if you know them:

Let me check what tools are available from your MCP servers:
Ran tool
Ran tool
Perfect! Your MCP tools are working. Here's how to use them effectively:

## 4. Available Tools and Usage Examples

### From `starfish_gen_template` server:
- **List templates**: "Show me all available data generation templates"
- **Generate city info**: "Generate information for cities: San Francisco, New York"
- **Run templates**: "Run the starfish/generate_by_topic template"

### From `starfish_data_gen_server` server:
- **Generate data**: "Generate 10 datapoints of synthetic data"
- **Probe model**: "Test the model with 5 ICD code datapoints"
- **Finetune model**: "Finetune the model for ICD code classification"

## 5. How to Use MCP Tools in Practice

### Example 1: Generate Data
```
You: "Generate 10 synthetic datapoints for training"
```
I will automatically call the appropriate MCP tool.

### Example 2: List Available Templates
```
You: "What data generation templates are available?"
```

### Example 3: Run Specific Template
```
You: "Run the generate_by_topic template with topics: AI, Machine Learning"
```

## 6. Best Practices

1. **Be specific** about what you want to accomplish
2. **Provide data** when needed (I'll ask if unclear)
3. **Check results** and iterate if needed
4. **Use natural language** - no need for technical syntax

## 7. Restart Cursor (if needed)

If you just updated your MCP configuration, restart Cursor to ensure the tools are loaded:

1. Quit Cursor completely
2. Reopen it
3. The MCP tools should now be available

## Try It Now!

You can test the MCP tools by asking me to:
- "List all available data generation templates"
- "Generate some sample data"
- "Show me what tools are available"

The tools will work seamlessly in our conversation - just tell me what you want to accomplish!