VS Code
VS Code extension that provides OCP capabilities to any AI agent through the VS Code Language Model Tool API.
Extension Installation
- Open VS Code Extensions
- Search “Open Context Protocol”
- Install the extension
Language Model Tools
The extension registers these tools with VS Code’s Language Model Tools API:
ocp_registerApi - Add APIs to make their tools available
Agent: "Register the GitHub API"
Result: 800+ GitHub tools now availableocp_listTools - List available tools, optionally filtered by API
Agent: "What GitHub tools are available?"
Result: search_issues, create_issue, get_repository, etc.ocp_callTool - Execute any registered tool with parameters
Agent: "Search for issues labeled 'bug'"
Result: Calls GitHub search_issues with label filterocp_searchTools - Find tools by name or description
Agent: "Find tools for creating tickets"
Result: create_issue, create_pull_request, etc.ocp_getContext - Get current workspace context and session state
Agent: "Show me the current context"
Result: User, workspace, registered APIs, session historyVS Code Settings
Configure the extension through VS Code settings:
{
"ocp.user": "john.doe",
"ocp.registryUrl": "https://registry.opencontextprotocol.org",
"ocp.apiAuth": {
"api-name": {
"Authorization": "Bearer your-token",
"X-Custom-Header": "custom-value"
}
}
}Settings:
ocp.user- User identifier (defaults to git username)ocp.registryUrl- Registry URL for API discoveryocp.apiAuth- API authentication headers by API name
API Authentication
API credentials are stored securely in VS Code settings:
{
"ocp.apiAuth": {
"api-name": {
"Authorization": "Bearer your-token",
"X-Custom-Header": "custom-value"
}
}
}Security:
- Credentials stay in VS Code settings
- Never exposed to AI agents
- Automatically injected during tool execution
Next: Agent Context
With OCP tools available in your IDE, learn how Agent Context maintains state and provides intelligent context management across your development workflow.