JZ

jiashengguo/zenstack-mcp-auth

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

9 stars 6 forks 품질 44 트렌드 17

ZenStack 원격 MCP 권한이 있는 서버

개요

모델 Context Protocol (MCP) Streamable HTTP 서버는 인증 및 자격 증명을 가진 데이터베이스의 자동 생성 된 CRUD 도구를 지원합니다. - : credential Authentication 지원을 가진 다수 동시 MCP 서버 연결. - : 자동적으로 ZenStack 스키마에 정의 된 모델의 CRUD 작업에 대한 MCP 도구를 생성합니다. 이 데모는 사용자 및 포스트 모델과 간단한 블로그 응용 프로그램을 사용합니다. 서버는 ZenStack 스키마에 정의된 각 모델의 MCP 도구를 자동으로 생성합니다. 지원되는 도구는 다음과 같습니다. - findUnique - findFirst - findMany - create - createMany - delete - deleteMany - update - updateMany - upsert - 집계 - 그룹별 - 개수 당신은 기능을 위한 사용 가능한 공구를 선택할 수 있습니다 mcp-server.ts의 변수명 그것은 게시물 3 사용자를 만듭니다. 모든 사용자의 암호는 password123입니다. - [email protected](으)로 이메일: [email protected] MCP 서버를 테스트하는 가장 쉬운 방법은 실행하는 것입니다

개요(AI 번역)

모델 Context Protocol (MCP) Streamable HTTP 서버는 인증 및 자격 증명을 가진 데이터베이스의 자동 생성 된 CRUD 도구를 지원합니다.

특징

  • MCP Streamable HTTP Protocol: credential Authentication 지원을 가진 다수 동시 MCP 서버 연결.
  • ZenStack Integration: 자동적으로 ZenStack 스키마에 정의된 모델의 CRUD 작업에 대한 MCP 도구를 생성합니다. 이 데모는 User]과 Post 모델을 사용하여 간단한 블로그 응용 프로그램을 사용합니다.

자동 생성 도구

서버는 ZenStack 스키마에 정의된 각 모델의 MCP 도구를 자동으로 생성합니다. 지원되는 도구는 다음과 같습니다.

  • 찾기Unique
  • 찾기
  • 찾기
  • 생성
  • 생성매니
  • 삭제
  • 삭제
  • 업데이트
  • 업데이트매니
  • 위시리스트
  • 집계
  • 그룹By
  • 수

functionNames] 변수를 mcp-server.ts에 대 한 사용 가능한 도구를 선택할 수 있습니다

빠른 시작

  1. 모든 의존성:

  2. ** 데이터베이스 설정**:

  3. ** 데이터베이스 ** (선택 사항) :

그것은 게시물 3 사용자를 만듭니다. 모든 사용자의 암호는 password123입니다.

  1. ** 서버 시작 **:

MCP Server 테스트

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

ZenStack Remote MCP Server with Authorization

A Model Context Protocol (MCP) Streamable HTTP server supporting auto-generated CRUD tools of database with Authorization and credential Authentication.

Features

  • MCP Streamable HTTP Protocol: Multiple simultaneous MCP server connections with credential Authentication support.
  • ZenStack Integration: Automatically generates MCP tools for the CRUD operations of the models defined in the ZenStack schema. This demo will use a simple blog application with User and Post models.

Auto-generated Tools

The server automatically generates MCP tools for each model defined in the ZenStack schema. Here are the supported tools:

  • findUnique
  • findFirst
  • findMany
  • create
  • createMany
  • delete
  • deleteMany
  • update
  • updateMany
  • upsert
  • aggregate
  • groupBy
  • count

You can opt-in available tools for functionNames variable in mcp-server.ts

Quick Start

  1. Install dependencies:

    npm install
    
  2. Set up the database:

    npx zenstack generate
    npx prisma db push
    
  3. Seed the database (optional):

    npx prisma db seed
    

    It create 3 users with posts. The passwords for all users are password123.

  4. Start the server:

    npm run dev
    

Testing the MCP Server

MCP Inspector

The easiest way to test the MCP server is to run

npx @modelcontextprotocol/inspector

MCP Client

If your chosen MCP client supports remote OAuth2 MCP server, you can directly connect. Otherwise, you can use mcp-remote to do it All the most popular MCP clients (Claude Desktop, Cursor, Github Copilot) use the following config format:

{
    "servers": {
        "my-mcp-server": {
            "command": "npx",
            "args": ["-y", "mcp-remote", "http://localhost:3001/mcp"]
        }
    }
}

Troubleshooting

Clear your ~/.mcp-auth directory

If you encounter an invalid client error when connecting to the MCP server, it may be due to that mcp-remote only register oauth client for the first time.you can fix it by removing the cached client state:

rm -rf ~/.mcp-auth

Delete old versions of Node in NVM for Claude Desktop

When using Claude Desktop, if you didn’t see any OAuth window open in your browser, it may be due to the fact that Claude Desktop is using an old version of Node.js even if you have a newer version installed. You can fix it by deleting old versions of Node.js in NVM.

GitHub에서 전체 README 보기

설치

npx -y mcp-remote http://localhost:3001/mcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →