Add mcp http server

This commit is contained in:
2026-04-16 11:51:24 +05:30
parent 2a44b77101
commit db0e249874
5 changed files with 363 additions and 6 deletions
+31 -4
View File
@@ -98,18 +98,45 @@ Add to your MCP client configuration:
}
```
**OpenCode (`.opencode/mcp.json`):**
**OpenCode (`.opencode/mcp.json` or `~/.config/opencode/opencode.json`):**
*stdio (local process):*
```json
{
"servers": {
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ask262": {
"command": "bun",
"args": ["run", "src/mcp-server.ts"]
"type": "local",
"command": ["bun", "run", "src/mcp-server.ts"],
"enabled": true,
"environment": {
"OLLAMA_HOST": "http://localhost:11434"
}
}
}
}
```
*http (stateless JSON server):*
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ask262": {
"type": "remote",
"url": "http://localhost:3000/mcp",
"enabled": true
}
}
}
```
Start the HTTP server first:
```bash
bun run mcp-http # Development
ask262-http # After npm install -g
```
### Testing
Test the MCP server before configuring your client: