kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: add xmcp example
rodzic
012f488931
commit
cd1ed46432
|
@ -56,3 +56,5 @@ out/
|
||||||
.eslintcache
|
.eslintcache
|
||||||
.nitro
|
.nitro
|
||||||
.tanstack
|
.tanstack
|
||||||
|
|
||||||
|
.xmcp
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default defineConfig({
|
||||||
{
|
{
|
||||||
slug: 'base',
|
slug: 'base',
|
||||||
usageType: 'licensed',
|
usageType: 'licensed',
|
||||||
amount: 1000
|
amount: 10_000_000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
slug: 'requests',
|
slug: 'requests',
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
.vercel
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { defineConfig } from '@agentic/platform'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
name: 'XMCP Example',
|
||||||
|
slug: 'xmcp',
|
||||||
|
description: 'TODO',
|
||||||
|
origin: {
|
||||||
|
type: 'mcp',
|
||||||
|
url: 'https://xmcp.vercel.app/mcp'
|
||||||
|
},
|
||||||
|
homepageUrl: 'https://xmcp.dev',
|
||||||
|
icon: './xmcp.svg'
|
||||||
|
})
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"name": "@agentic/examples-mcps-xmcp",
|
||||||
|
"private": true,
|
||||||
|
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/transitive-bullshit/agentic.git",
|
||||||
|
"directory": "examples/mcp-servers/xmcp"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "xmcp dev",
|
||||||
|
"build": "xmcp build --vercel",
|
||||||
|
"deploy": "vercel deploy --prod --prebuilt",
|
||||||
|
"test": "run-s test:*",
|
||||||
|
"test:typecheck": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@agentic/platform": "workspace:*",
|
||||||
|
"xmcp": "^0.1.6"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"swc-loader": "^0.2.6"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { type InferSchema } from 'xmcp'
|
||||||
|
import { z } from 'zod'
|
||||||
|
|
||||||
|
// Define the schema for tool parameters
|
||||||
|
export const schema = {
|
||||||
|
name: z.string().describe('The name of the user to greet')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define tool metadata
|
||||||
|
export const metadata = {
|
||||||
|
name: 'greet',
|
||||||
|
description: 'Greet the user',
|
||||||
|
annotations: {
|
||||||
|
title: 'Greet the user',
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tool implementation
|
||||||
|
export default async function greet({ name }: InferSchema<typeof schema>) {
|
||||||
|
const result = `Hello, ${name}!`
|
||||||
|
|
||||||
|
return {
|
||||||
|
content: [{ type: 'text', text: result }]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"extends": "@fisch0920/config/tsconfig-node",
|
||||||
|
"include": ["src", "*.config.ts", "xmcp-env.d.ts"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||||
|
"buildCommand": "xmcp build --vercel"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
/// <reference types="xmcp" />
|
||||||
|
|
||||||
|
// Do not edit this file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import type { XmcpConfig } from 'xmcp'
|
||||||
|
|
||||||
|
const config: XmcpConfig = {
|
||||||
|
http: {
|
||||||
|
port: 3002
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
|
@ -0,0 +1,6 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="512" height="512" fill="black"></rect>
|
||||||
|
<path d="M86 145.542H102.4V162.25H86V145.542ZM102.4 429.583V379.458H118.8V362.75H135.2V346.042H168V329.333H184.4V312.625H200.8V346.042H233.6V362.75H250V379.458H266.4V396.167H250V412.875H233.6V429.583H217.2V412.875H200.8V396.167H168V412.875H151.6V446.292H168V463H135.2V446.292H118.8V429.583H102.4ZM102.4 145.542V112.125H118.8V95.4167H135.2V78.7083H200.8V95.4167H233.6V112.125H250V145.542H266.4V162.25H282.8V178.958H299.2V195.667H282.8V212.375H364.8V229.083H348.4V245.792H315.6V279.208H332V295.917H348.4V312.625H364.8V346.042H381.2V362.75H397.6V379.458H364.8V396.167H348.4V412.875H332V396.167H315.6V362.75H299.2V329.333H282.8V312.625H266.4V279.208H233.6V262.5H118.8V245.792H135.2V229.083H151.6V212.375H217.2V195.667H200.8V162.25H184.4V128.833H168V112.125H151.6V128.833H118.8V145.542H102.4ZM200.8 312.625V295.917H217.2V312.625H200.8ZM217.2 295.917V279.208H233.6V295.917H217.2ZM266.4 379.458V362.75H282.8V379.458H266.4ZM266.4 145.542V128.833H282.8V145.542H266.4ZM282.8 128.833V112.125H299.2V78.7083H332V95.4167H364.8V78.7083H397.6V128.833H381.2V145.542H348.4V162.25H332V145.542H315.6V178.958H299.2V128.833H282.8ZM397.6 362.75V346.042H414V362.75H397.6ZM397.6 78.7083V62H414V78.7083H397.6Z" fill="white"></path>
|
||||||
|
</svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
|
||||||
|
@media (prefers-color-scheme: dark) { :root { filter: none; } }
|
||||||
|
</style></svg>
|
Po Szerokość: | Wysokość: | Rozmiar: 1.6 KiB |
2058
pnpm-lock.yaml
2058
pnpm-lock.yaml
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue