Initialize and run the MCP server.
()
| 196 | |
| 197 | |
| 198 | def main(): |
| 199 | """Initialize and run the MCP server.""" |
| 200 | |
| 201 | # Check for required environment variables |
| 202 | if "BOCHA_API_KEY" not in os.environ: |
| 203 | print( |
| 204 | "Error: BOCHA_API_KEY environment variable is required", |
| 205 | file=sys.stderr, |
| 206 | ) |
| 207 | print( |
| 208 | "Get a Bocha API key from: " "https://open.bochaai.com", |
| 209 | file=sys.stderr, |
| 210 | ) |
| 211 | sys.exit(1) |
| 212 | |
| 213 | print("Starting Bocha Search MCP server...", file=sys.stderr) |
| 214 | |
| 215 | server.run(transport="stdio") |
| 216 | |
| 217 | |
| 218 | if __name__ == "__main__": |
no test coverage detected