| 1 | --- |
| 2 | title: "Context Providers" |
| 3 | description: "Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context." |
| 4 | --- |
| 5 | |
| 6 | Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context. |
| 7 | |
| 8 |  |
| 9 | |
| 10 | ## Built-in Context Providers |
| 11 | |
| 12 | You can add any built-in context-providers in your config file as shown below: |
| 13 | |
| 14 | ### `@File` |
| 15 | |
| 16 | Reference any file in your current workspace. |
| 17 | |
| 18 | <Tabs> |
| 19 | <Tab title="YAML"> |
| 20 | ```yaml config.yaml |
| 21 | context: |
| 22 | - provider: file |
| 23 | ``` |
| 24 | </Tab> |
| 25 | <Tab title="JSON (Deprecated)"> |
| 26 | ```json config.json |
| 27 | { |
| 28 | "contextProviders": [ |
| 29 | { |
| 30 | "name": "file" |
| 31 | } |
| 32 | ] |
| 33 | } |
| 34 | ``` |
| 35 | </Tab> |
| 36 | </Tabs> |
| 37 | |
| 38 | ### `@Code` |
| 39 | |
| 40 | Reference specific functions or classes from throughout your project. |
| 41 | |
| 42 | <Tabs> |
| 43 | <Tab title="YAML"> |
| 44 | ```yaml config.yaml |
| 45 | context: |
| 46 | - provider: code |
| 47 | ``` |
| 48 | </Tab> |
| 49 | <Tab title="JSON (Deprecated)"> |
| 50 | ```json config.json |
| 51 | { |
| 52 | "contextProviders": [ |
| 53 | { |
| 54 | "name": "code" |
| 55 | } |
| 56 | ] |
| 57 | } |
| 58 | ``` |
| 59 | </Tab> |
| 60 | </Tabs> |
| 61 | |
| 62 | ### `@Git Diff` |
| 63 | |
| 64 | Reference all of the changes you've made to your current branch. This is useful if you want to summarize what you've done or ask for a general review of your work before committing. |
| 65 | |
| 66 | <Tabs> |
| 67 | <Tab title="YAML"> |
| 68 | ```yaml config.yaml |
| 69 | context: |
| 70 | - provider: diff |
| 71 | ``` |
| 72 | </Tab> |
| 73 | <Tab title="JSON (Deprecated)"> |
| 74 | ```json config.json |
| 75 | { |
| 76 | "contextProviders": [ |
| 77 | { |
| 78 | "name": "diff" |
| 79 | } |
| 80 | ] |
| 81 | } |
| 82 | ``` |
| 83 | </Tab> |
| 84 | </Tabs> |
| 85 | |
| 86 | ### `@Current File` |
| 87 | |
| 88 | Reference the currently open file. |
| 89 | |
| 90 | <Tabs> |
| 91 | <Tab title="YAML"> |
| 92 | ```yaml config.yaml |
| 93 | context: |
| 94 | - provider: currentFile |
| 95 | ``` |
| 96 | </Tab> |
| 97 | <Tab title="JSON (Deprecated)"> |
| 98 | ```json config.json |
| 99 | { |
| 100 | "contextProviders": [ |
| 101 | { |
| 102 | "name": "currentFile" |
| 103 | } |
| 104 | ] |
| 105 | } |
| 106 | ``` |
| 107 | </Tab> |
| 108 | </Tabs> |
| 109 | |
| 110 | ### `@Terminal` |
| 111 | |
| 112 | Reference the last command you ran in your IDE's terminal and its output. |
| 113 | |
| 114 | <Tabs> |
| 115 | <Tab title="YAML"> |
| 116 | ```yaml config.yaml |
| 117 | context: |
| 118 | - provider: terminal |
| 119 | ``` |
| 120 | </Tab> |
| 121 | <Tab title="JSON (Deprecated)"> |
| 122 | ```json config.json |
| 123 | { |
| 124 | "contextProviders": [ |
| 125 | { |
| 126 | "name": "terminal" |
| 127 | } |
| 128 | ] |
| 129 | } |
| 130 | ``` |
| 131 | </Tab> |
| 132 | </Tabs> |
| 133 | |
| 134 | ### `@Open` |
| 135 | |
| 136 | Reference the contents of all of your open files. Set `onlyPinned` to `true` to only reference pinned files. |
| 137 | |
| 138 | <Tabs> |
| 139 | <Tab title="YAML"> |
| 140 | ```yaml config.yaml |
| 141 | context: |
| 142 | - provider: open |
| 143 | params: |
| 144 | onlyPinned: true |
| 145 | ``` |
| 146 | </Tab> |
| 147 | <Tab title="JSON (Deprecated)"> |
| 148 | ```json config.json |
| 149 | { |
| 150 | "contextProviders": [ |
| 151 | { |
| 152 | "name": "open", |
| 153 | "params": { |
| 154 | "onlyPinned": true |
| 155 | } |
| 156 | } |
| 157 | ] |
| 158 | } |
| 159 | ``` |
| 160 | </Tab> |
| 161 | </Tabs> |
| 162 | |
| 163 | ### `@Clipboard` |
| 164 | |
| 165 | Reference recent clipboard items |
| 166 | |
| 167 | <Tabs> |
| 168 | <Tab title="YAML"> |
| 169 | ```yaml config.yaml |
| 170 | context: |
| 171 | - provider: clipboard |
| 172 | ``` |
| 173 | </Tab> |
| 174 | <Tab title="JSON (Deprecated)"> |
| 175 | ```json config.json |
| 176 | { |
| 177 | "contextProviders": [ |
| 178 | { |
| 179 | "name": "clipboard" |
| 180 | } |
| 181 | ] |
| 182 | } |
| 183 | ``` |
| 184 | </Tab> |
| 185 | </Tabs> |
| 186 | |
| 187 | ### `@Tree` |
| 188 | |
| 189 | Reference the structure of your current workspace. |
| 190 | |
| 191 | <Tabs> |
| 192 | <Tab title="YAML"> |
| 193 | ```yaml config.yaml |
| 194 | context: |
| 195 | - provider: tree |
| 196 | ``` |
| 197 | </Tab> |
| 198 | <Tab title="JSON (Deprecated)"> |
| 199 | ```json config.json |
| 200 | { |
| 201 | "contextProviders": [ |
| 202 | { |
| 203 | "name": "tree" |
| 204 | } |
| 205 | ] |
| 206 | } |
| 207 | ``` |
| 208 | </Tab> |
| 209 | </Tabs> |
| 210 | |
| 211 | ### `@Problems` |
| 212 | |
| 213 | Get Problems from the current file. |
| 214 | |
| 215 | <Tabs> |
| 216 | <Tab title="YAML"> |
| 217 | ```yaml config.yaml |
| 218 | context: |
| 219 | - provider: problems |
| 220 | ``` |
| 221 | </Tab> |
| 222 | <Tab title="JSON (Deprecated)"> |
| 223 | ```json config.json |
| 224 | { |
| 225 | "contextProviders": [ |
| 226 | { |
| 227 | "name": "problems" |
| 228 | } |
| 229 | ] |
| 230 | } |
| 231 | ``` |
| 232 | </Tab> |
| 233 | </Tabs> |
| 234 | |
| 235 | ### `@Debugger` |
| 236 | |
| 237 | Reference the contents of the local variables in the debugger. Currently only available in VS Code. |
| 238 | |
| 239 | <Tabs> |
| 240 | <Tab title="YAML"> |
| 241 | ```yaml config.yaml |
| 242 | context: |
| 243 | - provider: debugger |
| 244 | params: |
| 245 | stackDepth: 3 |
| 246 | ``` |
| 247 | </Tab> |
| 248 | <Tab title="JSON (Deprecated)"> |
| 249 | ```json config.json |
| 250 | { |
| 251 | "contextProviders": [ |
| 252 | { |
| 253 | "name": "debugger", |
| 254 | "params": { |
| 255 | "stackDepth": 3 |
| 256 | } |
| 257 | } |
| 258 | ] |
| 259 | } |
| 260 | ``` |
| 261 | </Tab> |
| 262 | </Tabs> |
| 263 | |
| 264 | Uses the top _n_ levels (defaulting to 3) of the call stack for that thread. |
| 265 | |
| 266 | ### `@Repository Map` |
| 267 | |
| 268 | Reference the outline of your codebase. By default, signatures are included along with file in the repo map. |
| 269 | |
| 270 | `includeSignatures` params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled. |
| 271 | |
| 272 | <Tabs> |
| 273 | <Tab title="YAML"> |
| 274 | ```yaml config.yaml |
| 275 | context: |
| 276 | - provider: repo-map |
| 277 | params: |
| 278 | includeSignatures: false # default true |
| 279 | ``` |
| 280 | </Tab> |
| 281 | <Tab title="JSON (Deprecated)"> |
| 282 | ```json config.json |
| 283 | { |
| 284 | "contextProviders": [ |
| 285 | { |
| 286 | "name": "repo-map", |
| 287 | "params": { |
| 288 | "includeSignatures": false // default true |
| 289 | } |
| 290 | } |
| 291 | ] |
| 292 | } |
| 293 | ``` |
| 294 | </Tab> |
| 295 | </Tabs> |
| 296 | |
| 297 | Provides a list of files and the call signatures of top-level classes, functions, and methods in those files. This helps the model better understand how a particular piece of code relates to the rest of the codebase. |
| 298 | |
| 299 | In the submenu that appears, you can select either `Entire codebase`, or specify a subfolder to generate the repostiory map from. |
| 300 | |
| 301 | This context provider is inpsired by [Aider's repository map](https://aider.chat/2023/10/22/repomap.html). |
| 302 | |
| 303 | ### `@Operating System` |
| 304 | |
| 305 | Reference the architecture and platform of your current operating system. |
| 306 | |
| 307 | <Tabs> |
| 308 | <Tab title="YAML"> |
| 309 | ```yaml config.yaml |
| 310 | context: |
| 311 | - provider: os |
| 312 | ``` |
| 313 | </Tab> |
| 314 | <Tab title="JSON (Deprecated)"> |
| 315 | ```json config.json |
| 316 | { |
| 317 | "contextProviders": [ |
| 318 | { |
| 319 | "name": "os" |
| 320 | } |
| 321 | ] |
| 322 | } |
| 323 | ``` |
| 324 | </Tab> |
| 325 | </Tabs> |
| 326 | |
| 327 | ### `@HTTP` |
| 328 | |
| 329 | The HttpContextProvider makes a POST request to the url passed in the configuration. The server must return 200 OK with a ContextItem object or an array of ContextItems. |
| 330 | |
| 331 | <Tabs> |
| 332 | <Tab title="YAML"> |
| 333 | ```yaml config.yaml |
| 334 | context: |
| 335 | - provider: http |
| 336 | params: |
| 337 | url: "https://api.example.com/v1/users" |
| 338 | headers: |
| 339 | - Authorization: "Bearer <token>" |
| 340 | ``` |
| 341 | </Tab> |
| 342 | <Tab title="JSON (Deprecated)"> |
| 343 | ```json config.json |
| 344 | { |
| 345 | "contextProviders": [ |
| 346 | { |
| 347 | "name": "http", |
| 348 | "params": { |
| 349 | "url": "https://api.example.com/v1/users" |
| 350 | } |
| 351 | } |
| 352 | ] |
| 353 | } |
| 354 | ``` |
| 355 | </Tab> |
| 356 | </Tabs> |
| 357 | |
| 358 | The receiving URL should expect to receive the following parameters: |
| 359 | |
| 360 | POST parameters |
| 361 | |
| 362 | ```json |
| 363 | { query: string, fullInput: string} |
| 364 | ``` |
| 365 | |
| 366 | The response 200 OK should be a JSON object with the following structure: |
| 367 | |
| 368 | Response |
| 369 | |
| 370 | ``` |
| 371 | [ { "name": "", "description": "", "content": "" }]// OR{ "name": "", "description": "", "content": ""} |
| 372 | ``` |
| 373 | |
| 374 | ### Model Context Protocol |
| 375 | |
| 376 | The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a standard proposed by Anthropic to unify prompts, context, and tool use. Continue supports any MCP server with the MCP context provider. Read their [quickstart](https://modelcontextprotocol.io/quickstart) to learn how to set up a local server and then set up your configuration like this: |
| 377 | |
| 378 | <Tabs> |
| 379 | <Tab title="YAML"> |
| 380 | ```yaml config.yaml |
| 381 | mcpServers: |
| 382 | - name: My MCP Server |
| 383 | command: uvx |
| 384 | args: |
| 385 | - mcp-server-sqlite |
| 386 | - --db-path |
| 387 | - /Users/NAME/test.db |
| 388 | ``` |
| 389 | </Tab> |
| 390 | <Tab title="JSON (Deprecated)"> |
| 391 | ```json config.json |
| 392 | { |
| 393 | "experimental": { |
| 394 | "modelContextProtocolServers": [ |
| 395 | { |
| 396 | "transport": { |
| 397 | "type": "stdio", |
| 398 | "command": "uvx", |
| 399 | "args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"] |
| 400 | } |
| 401 | } |
| 402 | ] |
| 403 | } |
| 404 | } |
| 405 | ``` |
| 406 | </Tab> |
| 407 | </Tabs> |
| 408 | |
| 409 | You'll then be able to type "@" and see "MCP" in the context providers dropdown. |
| 410 | |
| 411 | ## Deprecated Context Providers |
| 412 | |
| 413 | <Note> |
| 414 | To provide conext beyond the built-in context providers, we now recommend |
| 415 | using [MCP Servers](/customization/mcp-tools) |
| 416 | </Note> |
| 417 | |
| 418 | View the [deprecated context providers](/reference/deprecated-context-providers) for documentation on: |
| 419 | |
| 420 | - [`@Codebase`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead |
| 421 | - [`@Folder`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead |
| 422 | - [`@Docs`](/reference/deprecated-docs) - Use the [documentation awareness guide](/guides/codebase-documentation-awareness) instead |
| 423 | - `@Greptile` - Query Greptile index |
| 424 | - `@Commits` - Reference git commits |
| 425 | - `@Discord` - Reference Discord messages |
| 426 | - `@Jira` - Reference Jira issues |
| 427 | - `@Gitlab Merge Request` - Reference GitLab MRs |
| 428 | - `@Google` - Google search results |
| 429 | - `@Database` - Database schemas |
| 430 | - `@Issue` - GitHub issues |
| 431 | - `@Url` - URL content |
| 432 | - `@Search` - Codebase search |
| 433 | - `@Web` - Web search results |