xsMCP0.1.0-beta.2

Tools

Enable LLMs to perform actions through your server

With xsSchema, the parameters here can support multiple libraries such as Zod, Valibot, ArkType, Effect Schema, Sury... at the same time.

client.listTools

import { createClient } from '@xsmcp/client-shared'
import { createHttpTransport } from '@xsmcp/client-http'

const client = createClient({
  name: 'example-client',
  version: '1.0.0',
  transport: createHttpTransport({ url: 'http://localhost:3000/mcp' }),
})

await client.listTools()

client.callTool

import { createClient } from '@xsmcp/client-shared'
import { createHttpTransport } from '@xsmcp/client-http'

const client = createClient({
  name: 'example-client',
  version: '1.0.0',
  transport: createHttpTransport({ url: 'http://localhost:3000/mcp' }),
})

await client.callTool('add', { a: 1, b: 1 })
await client.callTool('echo', { message: 'Hello, World!' })
await client.callTool('getTinyImage', {})