(cliApiKey?: string)
| 30 | `; |
| 31 | |
| 32 | async function createServer(cliApiKey?: string) { |
| 33 | const server = new McpServer( |
| 34 | { |
| 35 | name: 'paystack', |
| 36 | version: '0.0.1', |
| 37 | }, |
| 38 | { |
| 39 | instructions: SERVER_INSTRUCTIONS, |
| 40 | }, |
| 41 | ); |
| 42 | |
| 43 | const oasPath = path.join(__dirname, './', 'data/paystack.openapi.yaml'); |
| 44 | const openapi = new OpenAPIParser(oasPath); |
| 45 | |
| 46 | await openapi.parse(); |
| 47 | |
| 48 | const bundledSkillPath = path.join(__dirname, 'data', 'paystack-skill.md'); |
| 49 | const skillContent = await loadSkillContent(bundledSkillPath); |
| 50 | |
| 51 | registerAllTools(server, openapi, cliApiKey); |
| 52 | registerAllResources(server, openapi, skillContent); |
| 53 | |
| 54 | return server; |
| 55 | } |
| 56 | |
| 57 | export async function startServer(cliApiKey?: string) { |
| 58 | const server = await createServer(cliApiKey); |
no test coverage detected