MCP Integration
Connect AI assistants to Sercha using the Model Context Protocol (MCP). This allows AI tools like Claude, ChatGPT, and Microsoft Copilot to search your indexed documents directly.
Prerequisites - Before you start, make sure you have:
- A running Sercha instance with indexed content
- For remote clients (Claude.ai, ChatGPT, Copilot): HTTPS and a public URL
- For Claude Desktop: Node.js installed (for
npx)
Available Tools
Sercha exposes three MCP tools that AI assistants can use:
| Tool | Description | Scope |
|---|---|---|
search | Search across all indexed documents using hybrid (BM25 + semantic) search | mcp:search |
get_document | Retrieve the full content and metadata of a document by ID | mcp:documents:read |
list_sources | List all available document sources | mcp:sources:list |
Your MCP Server URL
For local development:
http://localhost:8080/mcp
For production (required for Claude.ai, ChatGPT, Copilot):
https://your-sercha-domain.com/mcp
Claude.ai, ChatGPT, and Microsoft Copilot connect from their cloud infrastructure. Your Sercha instance must be publicly accessible over HTTPS for these clients to work.
Client Setup
- Claude.ai
- Claude Desktop
- ChatGPT
- Microsoft Copilot
Connect Sercha to Claude.ai to search your documents from the web interface.
For Pro and Max Plans
1. Open Connectors settings
Click your profile icon, then go to Customize → Connectors.
2. Add a custom connector
Click the + button, then select Add custom connector.
3. Enter your Sercha MCP URL
https://your-sercha-domain.com/mcp
4. Configure OAuth (optional)
Expand Advanced settings to enter OAuth credentials if you want automatic authentication:
| Field | Value |
|---|---|
| OAuth Client ID | (leave blank for dynamic registration) |
| OAuth Client Secret | (leave blank for dynamic registration) |
You can leave OAuth fields blank. Sercha supports Dynamic Client Registration, so Claude.ai will automatically register as a client.
5. Click Add
The connector is now configured.
6. Enable in conversations
In any conversation, click + → Connectors and toggle Sercha on.
For Team and Enterprise Plans
Admin setup (Owners only):
- Go to Organization settings → Connectors
- Click Add
- Select Custom → Web
- Enter your Sercha MCP URL
- Configure OAuth in Advanced settings (optional)
- Click Add
Member access:
- Go to Customize → Connectors
- Find the Sercha connector (labeled "Custom")
- Click Connect to authenticate
Limitations
| Plan | Custom Connector Limit |
|---|---|
| Free | 1 connector |
| Pro, Max, Team, Enterprise | Multiple connectors |
Connect Sercha to Claude Desktop using a local configuration file.
1. Locate your config file
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Create the file if it doesn't exist.
2. Add the Sercha MCP server
{
"mcpServers": {
"sercha": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8080/mcp"
]
}
}
}
Replace http://localhost:8080 with your Sercha server URL if different.
For remote servers, use HTTPS:
"args": ["-y", "mcp-remote", "https://your-sercha-domain.com/mcp"]
3. Restart Claude Desktop
Quit Claude Desktop completely and reopen it.
4. Authenticate
On first use, mcp-remote opens your browser for OAuth:
- Browser opens to Sercha login
- Log in and approve MCP permissions
- Return to Claude Desktop
The token is cached in ~/.mcp-auth/ — you won't need to re-authenticate unless it expires or is revoked.
5. Verify connection
Ask Claude:
"What MCP tools do you have access to?"
You should see search, get_document, and list_sources from Sercha.
Troubleshooting
"client not found" error
This happens when OAuth credentials are cached but the client no longer exists in Sercha (e.g., after a database reset).
Fix: Delete the cached credentials and restart Claude Desktop:
rm -rf ~/.mcp-auth/
Remove-Item -Recurse -Force "$env:USERPROFILE\.mcp-auth"
Tools not appearing
- Verify Claude Desktop was fully restarted
- Check
claude_desktop_config.jsonis valid JSON - Ensure Node.js is installed:
node --version
Connect Sercha to ChatGPT using OpenAI's MCP support.
ChatGPT connects to MCP servers from OpenAI's cloud infrastructure. Your Sercha instance must be publicly accessible over HTTPS.
1. Open ChatGPT settings
Click your profile icon → Settings → Connected apps (or similar, depending on UI version).
2. Add a new MCP server
Look for an option to add a custom app or MCP server.
3. Enter your Sercha MCP URL
https://your-sercha-domain.com/mcp
4. Authenticate
ChatGPT will redirect you to Sercha for OAuth authorization:
- Log in to Sercha
- Approve the requested permissions
- You're redirected back to ChatGPT
5. Use in conversations
Once connected, ChatGPT can call Sercha tools when relevant to your prompts.
Requirements
- HTTPS required — ChatGPT only connects to secure endpoints
- Public URL — Must be reachable from OpenAI's infrastructure
- OAuth 2.0 — Sercha handles this via Dynamic Client Registration
Connect Sercha to Microsoft Copilot Studio as an MCP server action.
1. Open your agent in Copilot Studio
Navigate to the agent you want to add Sercha to.
2. Add a new MCP tool
Go to Tools → Add a tool → New tool → Model Context Protocol.
3. Configure the server
| Field | Value |
|---|---|
| Server name | Sercha |
| Server description | Search indexed documents |
| Server URL | https://your-sercha-domain.com/mcp |
4. Configure authentication
Select OAuth 2.0 as the authentication type.
For the simplest setup, choose OAuth 2.0 dynamic client registration with discovery if available — Sercha supports this automatically.
For manual configuration:
| Field | Value |
|---|---|
| Authorization URL | https://your-sercha-domain.com/oauth/authorize |
| Token URL | https://your-sercha-domain.com/oauth/token |
| Scopes | mcp:search mcp:documents:read mcp:sources:list |
5. Complete setup
- Click Create
- Select Create a new connection (or use existing)
- Click Add to agent
6. Test the connection
In the agent test panel, try a prompt that would trigger a search.
Requirements
- HTTPS required — Copilot only connects to secure endpoints
- Public URL — Must be reachable from Microsoft's infrastructure
- Redirect URI — Sercha automatically accepts the Teams OAuth redirect
Example Prompts
Once connected, try these prompts with any AI assistant:
"Search my documents for authentication implementation"
"Find all documents related to the onboarding process"
"What sources do I have indexed?"
"Get the full content of document doc_abc123"
The AI will automatically call the appropriate Sercha tool and incorporate the results into its response.
Security
- OAuth 2.0 with PKCE — All authentication uses secure OAuth flows
- Scoped access — Tools only access what the scopes allow
- No write operations — MCP tools are read-only (search, retrieve, list)
- Dynamic Client Registration — Clients register automatically via RFC 7591
Deployment Checklist
For Claude.ai, ChatGPT, and Copilot (remote clients):
| Requirement | How to Set |
|---|---|
| HTTPS | Deploy behind a reverse proxy with SSL (nginx, Cloudflare, etc.) |
| Public URL | Ensure Sercha is accessible from the internet |
| BASE_URL | Set env var: BASE_URL=https://your-sercha-domain.com |
| UI_BASE_URL | Set env var: UI_BASE_URL=https://your-app-domain.com |
For Claude Desktop (local):
| Requirement | How to Set |
|---|---|
| Node.js | Install from nodejs.org |
| Config file | Create/edit claude_desktop_config.json |