File size: 3,334 Bytes
891fe52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Polyhedra IDE Configuration Guide

## What is MCP?

**MCP (Model Context Protocol)** is a protocol that allows AI assistants to call external tools.

```
You β†’ VS Code Copilot β†’ Polyhedra MCP Server β†’ Semantic Scholar API
      (chat)           (call tools)          (search papers)
```

## Configuration File Location

The configuration file is in your project's `.vscode/settings.json`:

```json
{
  "mcp.servers": {
    "polyhedra": {
      "command": "py",                    // ← Python launcher
      "args": ["-3.12", "-m", "polyhedra.server"],  // ← Run Polyhedra
      "env": {}
    }
  }
}
```

### What does this configuration do?

1. **Tells VS Code**: "There's an MCP server called polyhedra"
2. **Launch command**: Run `py -3.12 -m polyhedra.server`
3. **VS Code auto-starts**: When you open Copilot, it starts Polyhedra in the background

## How to Verify Configuration?

### Method 1: Reload VS Code Window

1. Press `Ctrl + Shift + P`
2. Type "Reload Window"
3. Press Enter

### Method 2: Check MCP Connection (if supported)

Some IDEs show MCP server status in settings.

## Usage Examples

After successful configuration, you can say in Copilot Chat:

### πŸ“ Example Conversation:

**You**: "Search for papers about transformers"

**Copilot** (internally):
1. Recognizes you want to search papers
2. Calls Polyhedra's `search_papers` tool
3. Passes parameters: query="transformer"
4. Gets results and shows them to you

**What you see**:
```
Found 10 papers:

1. Attention is All You Need
   Authors: Vaswani et al.
   Year: 2017
   Citations: 95,432
   ...
```

### πŸ“š More Examples:

```
"Initialize a new research project called ai-research"
β†’ Calls init_project tool

"Add this paper to my bibliography"
β†’ Calls add_citation tool

"Find similar papers about attention mechanisms"
β†’ Calls query_similar_papers tool
```

## Other IDE Configurations

### Cursor / Windsurf

Configuration file: `~/.cursor/mcp.json` or `~/.windsurf/mcp.json`

```json
{
  "mcpServers": {
    "polyhedra": {
      "command": "py",
      "args": ["-3.12", "-m", "polyhedra.server"]
    }
  }
}
```

## Common Issues

### Q: I configured it but it's not working?

**A**: Check:
1. Did you reload the VS Code window?
2. Is polyhedra installed in Python 3.12? (`py -3.12 -m pip show polyhedra`)
3. Does your GitHub Copilot version support MCP?

### Q: How to test if the MCP server can run?

**A**: Run in terminal:
```powershell
py -3.12 -m polyhedra.server
```
If there's no error, the server can start.

### Q: Does GitHub Copilot support MCP?

**A**: GitHub Copilot's MCP support may still be experimental.
**Alternative**: Use Cursor or Windsurf (native MCP support)

## Manual Testing (without IDE)

If MCP integration doesn't work, you can run scripts directly:

```powershell
py -3.12 demo_search.py
```

This directly calls Polyhedra's functionality to search papers.

## Summary

```
Configuration file (.vscode/settings.json)
    ↓
VS Code reads config on startup
    ↓
Starts Polyhedra MCP Server in background (py -3.12 -m polyhedra.server)
    ↓
Copilot can call Polyhedra's 10 tools
    ↓
You use these tools through natural language conversation
```

**Key Point**: The configuration file just tells the IDE how to start Polyhedra. The actual functionality is accessed through conversation.