MediaWiki MCP adapter

by lucamauri
Verified

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.

Integrations

  • Provides access to WikiBase APIs, with the default API base URL set to Wikidata's API endpoint for programmatic interaction.

  • Enables fetching and editing MediaWiki pages with the default API base URL set to Wikipedia's API endpoint, supporting page content retrieval and editing operations.

미디어위키어댑터

MediaWiki 및 WikiBase API와 상호 작용하기 위한 맞춤형 MCP(Model Context Protocol) 어댑터입니다. 이 어댑터를 사용하면 MCP 프레임워크를 사용하여 MediaWiki 페이지를 프로그래밍 방식으로 가져오고 편집할 수 있습니다.

특징

  • MediaWiki 페이지의 콘텐츠를 가져옵니다.
  • 새로운 콘텐츠와 선택적 요약을 추가하여 MediaWiki 페이지를 편집합니다.
  • 다양한 MediaWiki 및 WikiBase 인스턴스에 대한 구성 가능한 API 기반 URL입니다.

요구 사항

  • Node.js(v16 이상)
  • TypeScript(개발용)
  • API 액세스가 활성화된 MediaWiki 인스턴스

설치

  1. 저장소를 복제합니다.

지엑스피1

  1. 종속성 설치:
    npm install
  2. 프로젝트를 빌드하세요:
    npm run build

용법

어댑터 구성

사용자 정의 MediaWiki 및 WikiBase API 엔드포인트를 사용하도록 어댑터를 구성할 수 있습니다.

server.configure({ mediaWikiAPIBase: "https://my.mediawiki.instance/api.php", wikiBaseAPIBase: "https://my.wikibase.instance/api.php", });

MCP 서버 시작

다음 명령을 사용하여 MCP 서버를 실행합니다.

node build/index.js

자원

getPageContent

MediaWiki 페이지의 콘텐츠를 가져옵니다.

  • 입력 스키마 :
{ "title": "string" }
  • 출력 스키마 :
    { "content": "string" }

사용 예:

const response = await server.callResource("getPageContent", { title: "Main Page", }); console.log(response.content);

도구

편집페이지

새로운 콘텐츠로 MediaWiki 페이지를 편집합니다.

  • 입력 스키마 :
{ "title": "string", "content": "string", "summary": "string (optional)" }
  • 출력 스키마 :
{ "success": "boolean" }

사용 예:

const response = await server.callTool("editPage", { title: "Main Page", content: "Updated content for the page.", summary: "Updated via MediaWikiAdapter", }); console.log(response.success ? "Edit successful" : "Edit failed");

개발

개발 모드에서 실행

TypeScript를 사용하여 개발 모드에서 프로젝트를 실행하려면:

npm run dev

린팅

linter를 실행하여 코드 품질을 확인하세요.

npm run lint

테스트

현재 구현된 테스트는 없습니다. test 디렉터리에 테스트를 추가하고 다음을 사용하여 실행할 수 있습니다.

npm test

구성

어댑터는 다음과 같은 기본 API 기반 URL을 사용합니다.

server.configure() 메서드를 사용하여 이러한 기본값을 재정의할 수 있습니다.


기여하다

여러분의 참여를 환영합니다! 다음 단계를 따라주세요.

  1. 저장소를 포크합니다.
  2. 기능이나 버그 수정을 위해 새로운 브랜치를 만듭니다.
  3. 변경 사항에 대한 자세한 설명과 함께 풀 리퀘스트를 제출하세요.

특허

이 프로젝트는 LGPL-3.0 이상 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.


작가

루카 마우리 가 만들었습니다.

-
security - not tested
A
license - permissive license
-
quality - not tested

MediaWiki 및 WikiBase API를 위한 사용자 정의 모델 컨텍스트 프로토콜 어댑터

  1. Features
    1. Requirements
      1. Installation
        1. Usage
          1. Configure the Adapter
          2. Start the MCP Server
          3. Resources
          4. Tools
        2. Development
          1. Run in Development Mode
          2. Linting
          3. Testing
        3. Configuration
          1. Contributing
            1. License
              1. Author
                ID: 2kd2tl3hsl