Skip to main content
Glama

OpenRouter MCP Server

OpenRouter MCP 서버

OpenRouter.ai의 다양한 모델 생태계와 원활하게 통합되는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 내장된 캐싱, 속도 제한 및 오류 처리 기능을 갖춘 통합되고 유형이 안전한 인터페이스를 통해 다양한 AI 모델에 액세스하세요.

특징

  • 모델 액세스
    • 모든 OpenRouter.ai 모델에 직접 액세스
    • 자동 모델 검증 및 기능 검사
    • 기본 모델 구성 지원
  • 성능 최적화
    • 스마트 모델 정보 캐싱(1시간 만료)
    • 자동 요금 제한 관리
    • 실패한 요청에 대한 지수적 백오프
  • 통합 응답 형식
    • 모든 응답에 대한 일관된 ToolResult 구조
    • isError 플래그로 오류 식별을 지웁니다.
    • 컨텍스트가 포함된 구조화된 오류 메시지

설치

지엑스피1

구성

필수 조건

  1. OpenRouter Keys 에서 OpenRouter API 키를 받으세요
  2. 기본 모델을 선택하세요(선택 사항)

환경 변수

OPENROUTER_API_KEY=your-api-key-here OPENROUTER_DEFAULT_MODEL=optional-default-model

설정

MCP 설정 구성 파일( cline_mcp_settings.json 또는 claude_desktop_config.json )에 다음을 추가합니다.

{ "mcpServers": { "openrouterai": { "command": "npx", "args": ["@mcpservers/openrouterai"], "env": { "OPENROUTER_API_KEY": "your-api-key-here", "OPENROUTER_DEFAULT_MODEL": "optional-default-model" } } } }

응답 형식

모든 도구는 표준화된 구조로 응답을 반환합니다.

interface ToolResult { isError: boolean; content: Array<{ type: "text"; text: string; // JSON string or error message }>; }

성공 사례:

{ "isError": false, "content": [{ "type": "text", "text": "{\"id\": \"gen-123\", ...}" }] }

오류 예:

{ "isError": true, "content": [{ "type": "text", "text": "Error: Model validation failed - 'invalid-model' not found" }] }

사용 가능한 도구

채팅_완료

OpenRouter.ai 모델에 메시지 보내기:

interface ChatCompletionRequest { model?: string; messages: Array<{role: "user"|"system"|"assistant", content: string}>; temperature?: number; // 0-2 } // Response: ToolResult with chat completion data or error

검색_모델

사용 가능한 모델을 검색하고 필터링하세요.

interface ModelSearchRequest { query?: string; provider?: string; minContextLength?: number; capabilities?: { functions?: boolean; vision?: boolean; }; } // Response: ToolResult with model list or error

모델 정보 얻기

특정 모델에 대한 자세한 정보를 얻으세요:

{ model: string; // Model identifier }

모델 검증

모델 ID가 유효한지 확인하세요:

interface ModelValidationRequest { model: string; } // Response: // Success: { isError: false, valid: true } // Error: { isError: true, error: "Model not found" }

오류 처리

서버는 구조화된 오류에 컨텍스트 정보를 제공합니다.

// Error response structure { isError: true, content: [{ type: "text", text: "Error: [Category] - Detailed message" }] }

일반적인 오류 범주:

  • Validation Error : 잘못된 입력 매개변수
  • API Error : OpenRouter API 통신 문제
  • Rate Limit : 요청 제한 감지
  • Internal Error : 서버 측 처리 실패

응답 처리:

async function handleResponse(result: ToolResult) { if (result.isError) { const errorMessage = result.content[0].text; if (errorMessage.startsWith('Error: Rate Limit')) { // Handle rate limiting } // Other error handling } else { const data = JSON.parse(result.content[0].text); // Process successful response } }

개발

자세한 내용은 CONTRIBUTING.md를 참조하세요.

  • 개발 설정
  • 프로젝트 구조
  • 기능 구현
  • 오류 처리 지침
  • 도구 사용 예
# Install dependencies pnpm install # Build project pnpm run build # Run tests pnpm test

변경 사항

최신 업데이트 내용은 CHANGELOG.md를 참조하세요.

  • 통합 응답 형식 구현
  • 향상된 오류 처리 시스템
  • 유형 안전 인터페이스 개선

특허

이 프로젝트는 Apache License 2.0에 따라 라이선스가 부여되었습니다. 자세한 내용은 LICENSE 파일을 참조하세요.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

OpenRouter.ai와 통합을 제공하여 통합 인터페이스를 통해 다양한 AI 모델에 액세스할 수 있습니다.

  1. 특징
    1. 설치
      1. 구성
        1. 필수 조건
        2. 환경 변수
        3. 설정
      2. 응답 형식
        1. 사용 가능한 도구
          1. 채팅\_완료
          2. 검색\_모델
          3. 모델 정보 얻기
          4. 모델 검증
        2. 오류 처리
          1. 개발
            1. 변경 사항
              1. 특허

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  This server facilitates the invocation of AI models from providers like Anthropic, OpenAI, and Groq, enabling users to manage and configure large language model interactions seamlessly.
                  Last updated -
                  9
                  Python
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A proxy server that bridges AI agents and external APIs by dynamically translating OpenAPI specifications into standardized MCP tools, enabling seamless interaction without custom integration code.
                  Last updated -
                  39
                  Python
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables AI agents to interact with multiple LLM providers (OpenAI, Anthropic, Google, DeepSeek) through a standardized interface, making it easy to switch between models or use multiple models in the same application.
                  Last updated -
                  3
                  Python
                  MIT License
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An AI router that connects applications to multiple LLM providers (OpenAI, Anthropic, Google, DeepSeek, Ollama, etc.) with smart model orchestration capabilities, enabling dynamic switching between models for different reasoning tasks.
                  Last updated -
                  3
                  8
                  11
                  TypeScript
                  MIT License
                  • Linux
                  • Apple

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/heltonteixeira/openrouterai'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server