MCP Apps Kit - v0.5.0
    Preparing search index...

    Function createApp

    • Create an MCP app with unified tool and UI definitions

      Supports both single-version (backward compatible) and multi-version configurations.

      Type Parameters

      Parameters

      • config: AppConfigInput<T>

        App configuration with tools and UI resources

      Returns App<T>

      App instance for starting server or getting middleware

      const app = createApp({
      name: "my-app",
      version: "1.0.0",
      tools: {
      greet: {
      description: "Greet a user",
      input: z.object({ name: z.string() }),
      output: z.object({ message: z.string() }),
      handler: async ({ name }) => ({ message: `Hello, ${name}!` }),
      },
      },
      });

      await app.start({ port: 3000 });
      const app = createApp({
      name: "my-app",
      config: {
      oauth: { authorizationServer: "https://auth.example.com" },
      cors: { origin: true }
      },
      versions: {
      v1: {
      version: "1.0.0",
      tools: { greet: {...} }
      },
      v2: {
      version: "2.0.0",
      tools: { greet: {...}, search: {...} }
      }
      }
      });