Brightsy MCP 서버
이는 Brightsy AI 에이전트에 연결되는 MCP(Model Context Protocol) 서버입니다.
설치
지엑스피1
Related MCP server: Bluesky MCP Server
용법
서버를 시작하려면:
npm start -- --agent-id=<your-agent-id> --api-key=<your-api-key>
또는 위치적 인수를 사용하여:
npm start -- <your-agent-id> <your-api-key> [tool-name] [message]
또한 상담원에게 보낼 초기 메시지를 제공할 수도 있습니다.
npm start -- --agent-id=<your-agent-id> --api-key=<your-api-key> --message="Hello, agent!"
도구 이름 사용자 정의
기본적으로 MCP 서버는 "brightsy"라는 이름의 도구를 등록합니다. --tool-name 매개변수를 사용하여 이 이름을 사용자 지정할 수 있습니다.
npm start -- --agent-id=<your-agent-id> --api-key=<your-api-key> --tool-name=<custom-tool-name>
도구 이름을 세 번째 위치 인수로 설정할 수도 있습니다.
npm start -- <your-agent-id> <your-api-key> <custom-tool-name>
또는 BRIGHTSY_TOOL_NAME 환경 변수를 사용합니다.
export BRIGHTSY_TOOL_NAME=custom-tool-name
npm start -- --agent-id=<your-agent-id> --api-key=<your-api-key>
환경 변수
다음 환경 변수를 사용하여 서버를 구성할 수 있습니다.
BRIGHTSY_AGENT_ID : 사용할 에이전트 ID(명령줄 인수의 대안)
BRIGHTSY_API_KEY : 사용할 API 키(명령줄 인수의 대안)
BRIGHTSY_TOOL_NAME : 등록할 도구 이름(기본값: "brightsy")
agent_proxy 도구 테스트
agent_proxy 도구를 사용하면 Brightsy AI 에이전트로 요청을 프록시할 수 있습니다. 제공된 테스트 스크립트를 사용하여 이 도구를 테스트할 수 있습니다.
필수 조건
테스트를 실행하기 전에 다음 환경 변수를 설정하세요.
export AGENT_ID=your-agent-id
export API_KEY=your-api-key
# Optional: customize the tool name for testing
export TOOL_NAME=custom-tool-name
또는 다음 값을 명령줄 인수로 전달할 수 있습니다.
# Using named arguments
npm run test:cli -- --agent-id=your-agent-id --api-key=your-api-key --tool-name=custom-tool-name
# Using positional arguments
npm run test:cli -- your-agent-id your-api-key custom-tool-name
테스트 실행
모든 테스트를 실행하려면:
특정 테스트를 실행하려면:
# Test using the command line interface
npm run test:cli
# Test using the direct MCP protocol
npm run test:direct
테스트 스크립트
명령줄 테스트 ( test-agent-proxy.ts ): 테스트 메시지로 MCP 서버를 실행하여 agent_proxy 도구를 테스트합니다.
직접 MCP 프로토콜 테스트 ( test-direct.ts ): 올바르게 형식화된 MCP 요청을 서버에 직접 전송하여 agent_proxy 도구를 테스트합니다.
도구 작동 방식
MCP 서버는 OpenAI 호환 AI 에이전트에 요청을 전달하고 응답을 반환하는 도구(기본적으로 "brightsy")를 등록합니다. 이 도구는 role 및 content 속성을 가진 메시지 객체의 배열인 messages 매개변수를 사용합니다.
MCP 클라이언트에서의 사용 예:
// Using the default tool name
const response = await client.callTool("brightsy", {
messages: [
{
role: "user",
content: "Hello, can you help me with a simple task?"
}
]
});
// Or using a custom tool name if configured
const response = await client.callTool("custom-tool-name", {
messages: [
{
role: "user",
content: "Hello, can you help me with a simple task?"
}
]
});
응답에는 content 필드에 에이전트의 답변이 포함됩니다.