open-index/open-npm huggingface dataset:
npm package: @metorial/ai-sdk
Description: AI SDK integration for Metorial - provides compatibility with Vercel's AI SDK for streamlined tool usage.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/ai-sdk

AI SDK integration for Metorial - provides compatibility with Vercel's AI SDK for streamlined tool usage.

## Installation

```bash
npm install @metorial/ai-sdk
# or
yarn add @metorial/ai-sdk
# or
pnpm add @metorial/ai-sdk
# or
bun add @metorial/ai-sdk
```

## Usage

```typescript
import { metorialAISDK } from '@metorial/ai-sdk';
import { Metorial } from 'metorial';
import { openai } from '@ai-sdk/openai';
import { generateText } from 'ai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

await metorial.withProviderSession(
  metorialAISDK,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let { text } = await generateText({
      model: openai('gpt-4o'),
      prompt:
        'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub.',
      tools: session.tools
    });

    console.log('Generated text:', text);
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/anthropic
Description: Anthropic provider integration for Metorial - enables using Metorial tools with Anthropic's NLP models.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/anthropic

Anthropic provider integration for Metorial - enables using Metorial tools with Anthropic's NLP models.

## Installation

```bash
npm install @metorial/anthropic
# or
yarn add @metorial/anthropic
# or
pnpm add @metorial/anthropic
# or
bun add @metorial/anthropic
```

## Usage

```typescript
import { metorialAnthropic } from '@metorial/anthropic';
import { Metorial } from 'metorial';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let anthropic = new OpenAI({
  apiKey: 'your-anthropic-api-key',
  baseURL: 'https://api.anthropic.com/v1'
});

await metorial.withProviderSession(
  metorialAnthropic,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let messages = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    let response = await anthropic.chat.completions.create({
      model: 'claude-3-5-sonnet-20241022',
      messages,
      tools: session.tools
    });

    let choice = response.choices[0]!;
    let toolCalls = choice.message.tool_calls;

    if (toolCalls && toolCalls.length > 0) {
      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(choice.message.content);
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/cli
Description: npm wrapper for the Metorial CLI
Latest version: 0.0.0-dev.12

# `@metorial/cli`

The official npm package for the Metorial CLI.

Metorial helps you deploy and manage providers for AI applications. This package gives you the `metorial` command through npm so you can inspect providers, deployments, sessions, integrations, and related resources directly from your terminal.

## Install

Install globally:

```bash
npm install -g @metorial/cli
```

Or run without installing:

```bash
npx @metorial/cli@latest
```

## What You Can Do

Use the CLI to:

- inspect providers and deployments
- review sessions and integrations
- send authenticated API requests
- start from official examples

## Common Commands

```bash
metorial login
metorial providers list
metorial deployments list
metorial sessions list
metorial integrations list
metorial example list
metorial open
```

## Help

```bash
metorial --help
metorial <command> --help
```

If you want to start from an example project, use `npm create metorial@latest` to browse examples or `npm create metorial@latest <identifier>` to create one directly.
npm package: @metorial/cli-core
Description: Runtime helpers for downloading and invoking the Metorial CLI
Latest version: 0.0.0-dev.12

# `@metorial/cli-core`

Shared runtime helpers for npm packages that launch the official Metorial CLI.

Most users should install [`@metorial/cli`](https://www.npmjs.com/package/@metorial/cli) instead. This package is for package authors and wrapper commands that want to delegate to the Metorial CLI from Node.js.

```bash
npm install -g @metorial/cli
```
npm package: @metorial/deepseek
Description: DeepSeek provider integration for Metorial - enables using Metorial tools with DeepSeek's language models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/deepseek

DeepSeek provider integration for Metorial - enables using Metorial tools with DeepSeek's language models through function calling.

## Installation

```bash
npm install @metorial/deepseek
# or
yarn add @metorial/deepseek
# or
pnpm add @metorial/deepseek
# or
bun add @metorial/deepseek
```

## Usage

```typescript
import { metorialDeepSeek } from '@metorial/deepseek';
import { Metorial } from 'metorial';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let deepseek = new OpenAI({
  apiKey: 'your-deepseek-api-key',
  baseURL: 'https://api.deepseek.com'
});

await metorial.withProviderSession(
  metorialDeepSeek,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let messages = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    for (let i = 0; i < 10; i++) {
      let response = await deepseek.chat.completions.create({
        model: 'deepseek-chat',
        messages,
        tools: session.tools
      });

      let choice = response.choices[0]!;
      let toolCalls = choice.message.tool_calls;

      if (!toolCalls) {
        console.log(choice.message.content);
        return;
      }

      let toolResponses = await session.callTools(toolCalls);

      messages.push(
        {
          role: 'assistant',
          tool_calls: choice.message.tool_calls
        },
        ...toolResponses
      );
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/google
Description: Google (Gemini) provider integration for Metorial - enables using Metorial tools with Google's Gemini models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/google

Google (Gemini) provider integration for Metorial - enables using Metorial tools with Google's Gemini models through function calling.

## Installation

```bash
npm install @metorial/google
# or
yarn add @metorial/google
# or
pnpm add @metorial/google
# or
bun add @metorial/google
```

## Usage

```typescript
import { metorialGoogle } from '@metorial/google';
import { Metorial } from 'metorial';
import { GoogleGenAI } from '@google/genai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let genAI = new GoogleGenAI({
  apiKey: 'your-google-api-key'
});

await metorial.withProviderSession(
  metorialGoogle,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let response = await genAI.models.generateContent({
      model: 'gemini-1.5-pro-latest',
      contents: [
        {
          role: 'user',
          parts: [
            {
              text: 'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub.'
            }
          ]
        }
      ],
      config: {
        tools: session.tools
      }
    });

    // Handle function calls and tool responses
    let result = response.response;
    let functionCalls = result.candidates?.[0]?.content?.parts?.filter(
      part => part.functionCall
    );

    if (functionCalls && functionCalls.length > 0) {
      let toolCalls = functionCalls.map(fc => ({
        id: `call_${Date.now()}`,
        type: 'function' as const,
        function: {
          name: fc.functionCall!.name,
          arguments: fc.functionCall!.args
        }
      }));

      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(result.text());
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/langchain
Description: LangChain integration for Metorial - provides compatibility with LangChain for streamlined tool usage.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/langchain

LangChain integration for Metorial - provides compatibility with LangChain for streamlined tool usage.

## Installation

```bash
npm install @metorial/langchain
# or
yarn add @metorial/langchain
# or
pnpm add @metorial/langchain
# or
bun add @metorial/langchain
```

## Usage

```typescript
import { ChatOpenAI } from '@langchain/openai';
import { metorialLangchain } from '@metorial/langchain';
import { Metorial } from '@metorial/sdk';
import { createAgent } from 'langchain';

let metorial = new Metorial({ apiKey: 'your-metorial-api-key' });

metorial.withProviderSession(
  metorialLangchain,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    console.log('Session tools:', session.tools);

    let agent = createAgent({
      model: new ChatOpenAI({ model: 'gpt-5' }),
      tools: session.tools
    });

    let result = await agent.invoke({
      messages: [{ role: 'user', content: 'What are the top stories on HackerNews?' }]
    });

    console.log('Result:', JSON.stringify(result, null, 2));
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/mcp-session
Description: MCP session management for Metorial. Provides session handling and tool lifecycle management for Model Context Protocol.
Author: Metorial Inc.
Latest version: 2.1.1

# @metorial/mcp-session

MCP session management for Metorial. Provides session handling and tool lifecycle management for Model Context Protocol.

## Installation

```bash
npm install @metorial/mcp-session
# or
yarn add @metorial/mcp-session
# or
pnpm add @metorial/mcp-session
# or
bun add @metorial/mcp-session
```

## Usage

This package provides direct MCP session management for advanced use cases.

```typescript
import { MetorialMcpSession } from '@metorial/mcp-session';
import { Metorial } from 'metorial';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

// Create an MCP session instance
let mcpSession = new MetorialMcpSession(metorial, {
  serverDeployments: ['your-server-deployment-id']
});

// Get the session metadata
let session = await mcpSession.getSession();

// Get the tool manager
let toolManager = await mcpSession.getToolManager();

// Get available tools
let tools = toolManager.getTools();

// Call a tool directly
let searchContextTool = tools.find(t => t.name === 'searchContext');
if (searchContextTool) {
  let toolResponse = await searchContextTool.call({
    query: 'metorial websocket explorer',
    maxResults: 3
  });
  console.log('Tool response:', toolResponse);
}

// Clean up the session
await mcpSession.close();
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/mistral
Description: Mistral AI provider integration for Metorial - enables using Metorial tools with Mistral's language models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/mistral

Mistral AI provider integration for Metorial - enables using Metorial tools with Mistral's language models through function calling.

## Installation

```bash
npm install @metorial/mistral
# or
yarn add @metorial/mistral
# or
pnpm add @metorial/mistral
# or
bun add @metorial/mistral
```

## Usage

```typescript
import { metorialMistral } from '@metorial/mistral';
import { Metorial } from 'metorial';
import { Mistral } from '@mistralai/mistralai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let mistral = new Mistral({
  apiKey: 'your-mistral-api-key'
});

await metorial.withProviderSession(
  metorialMistral,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    // make tools Mistral compatibility
    let fixedTools = session.tools.map(tool => {
      if (tool.function?.parameters) {
        let fixedParams = { ...tool.function.parameters };
        fixedParams.additionalProperties = false;

        if (fixedParams.properties) {
          Object.values(fixedParams.properties).forEach((prop: any) => {
            if (prop && typeof prop === 'object' && prop.type === 'object') {
              prop.additionalProperties = false;
            }
          });
        }

        return {
          ...tool,
          function: {
            ...tool.function,
            parameters: fixedParams
          }
        };
      }
      return tool;
    });

    let messages: any[] = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    let response = await mistral.chat.complete({
      model: 'mistral-large-latest',
      messages,
      tools: fixedTools
    });

    let choice = response.choices[0];
    let toolCalls = choice.message.toolCalls;

    if (toolCalls && toolCalls.length > 0) {
      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(choice.message.content);
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/object-storage-client
Description: TypeScript client for Object Storage Service
Author: Object Storage Team
Latest version: 0.1.0

# Object Storage Client for TypeScript

TypeScript/JavaScript client library for interacting with the Object Storage Service.

## Usage

```typescript
import { ObjectStorageClient } from 'object-storage-client';

const client = new ObjectStorageClient('http://localhost:8080');

// Create a bucket
const bucket = await client.createBucket('my-bucket');
console.log(`Created bucket: ${bucket.name}`);

// Upload an object
const data = Buffer.from('Hello, World!');
const obj = await client.putObject(
  'my-bucket',
  'hello.txt',
  data,
  'text/plain',
  { key1: 'value1' }
);
console.log(`Uploaded object: ${obj.key} (ETag: ${obj.etag})`);

// Download an object
const objData = await client.getObject('my-bucket', 'hello.txt');
console.log(`Downloaded ${objData.data.length} bytes`);

// List objects
const objects = await client.listObjects('my-bucket');
for (const obj of objects) {
  console.log(`${obj.key}: ${obj.size} bytes`);
}

// Delete object
await client.deleteObject('my-bucket', 'hello.txt');

// Delete bucket
await client.deleteBucket('my-bucket');
```

## API Reference

### Client Creation

```typescript
const client = new ObjectStorageClient('http://localhost:8080');
```

With custom timeout:

```typescript
const client = new ObjectStorageClient('http://localhost:8080', 60000);
```

### Bucket Operations

**Create Bucket**
```typescript
const bucket = await client.createBucket('bucket-name');
```

**List Buckets**
```typescript
const buckets = await client.listBuckets();
```

**Delete Bucket**
```typescript
await client.deleteBucket('bucket-name');
```

### Object Operations

**Put Object**
```typescript
const data = Buffer.from('content');
const obj = await client.putObject(
  'bucket-name',
  'object-key',
  data,
  'application/json',
  { key: 'value' }
);
```

**Get Object**
```typescript
const objData = await client.getObject('bucket-name', 'object-key');
// objData.data contains the object buffer
// objData.metadata contains metadata
```

**Head Object**
```typescript
const metadata = await client.headObject('bucket-name', 'object-key');
```

**Delete Object**
```typescript
await client.deleteObject('bucket-name', 'object-key');
```

**List Objects**
```typescript
// List all objects
const objects = await client.listObjects('bucket-name');

// List with prefix
const objects = await client.listObjects('bucket-name', 'prefix/');

// List with prefix and max keys
const objects = await client.listObjects('bucket-name', 'prefix/', 100);
```

## Error Handling

The client throws `ObjectStorageError` for API errors:

```typescript
import { ObjectStorageError } from 'object-storage-client';

try {
  const obj = await client.getObject('bucket', 'key');
} catch (error) {
  if (error instanceof ObjectStorageError) {
    console.log(`Status: ${error.statusCode}, Message: ${error.message}`);
  }
}
```
npm package: @metorial/openai
Description: OpenAI provider integration for Metorial - enables using Metorial tools with OpenAI's GPT models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/openai

OpenAI provider integration for Metorial - enables using Metorial tools with OpenAI's GPT models through function calling.

## Installation

```bash
npm install @metorial/openai
# or
yarn add @metorial/openai
# or
pnpm add @metorial/openai
# or
bun add @metorial/openai
```

## Usage

### Basic Usage

```typescript
import { Metorial } from 'metorial';
import { metorialOpenAI } from '@metorial/openai';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let openai = new OpenAI({
  apiKey: 'your-openai-api-key'
});

await metorial.withProviderSession(
  metorialOpenAI.chatCompletions,
  { serverDeployments: ['your-server-deployment-id'] },
  async session => {
    let messages = [{ role: 'user', content: 'What are the latest commits?' }];

    let response = await openai.chat.completions.create({
      model: 'gpt-4o',
      messages,
      tools: session.tools
    });

    // Handle tool calls
    let toolCalls = response.choices[0]?.message.tool_calls;
    if (toolCalls) {
      let toolResponses = await session.callTools(toolCalls);
      messages.push({ role: 'assistant', tool_calls: toolCalls }, ...toolResponses);
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/openai-compatible
Description: OpenAI-compatible provider base for Metorial. Provides common functionality for OpenAI-compatible API providers.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/openai-compatible

OpenAI-compatible provider base for Metorial. Provides common functionality for OpenAI-compatible API providers.

## Installation

```bash
npm install @metorial/openai-compatible
# or
yarn add @metorial/openai-compatible
# or
pnpm add @metorial/openai-compatible
# or
bun add @metorial/openai-compatible
```

## Usage

This package provides a factory function to create OpenAI-compatible MCP SDKs for any OpenAI-compatible API.

```typescript
import { createOpenAICompatibleMcpSdk } from '@metorial/openai-compatible';
import { Metorial } from 'metorial';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

// Create an OpenAI-compatible provider
let metorialOpenAICompatible = createOpenAICompatibleMcpSdk({});

await metorial.withProviderSession(
  metorialOpenAICompatible,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    // Use any OpenAI-compatible client
    let openai = new OpenAI({
      apiKey: 'your-openai-api-key'
    });

    let messages = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    let response = await openai.chat.completions.create({
      model: 'gpt-4o-mini',
      messages,
      tools: session.tools
    });

    let choice = response.choices[0]!;
    let toolCalls = choice.message.tool_calls;

    if (toolCalls && toolCalls.length > 0) {
      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(choice.message.content);
    }
  }
);
```

## Dependencies

- `@metorial/core`: Core Metorial functionality
- `@metorial/mcp-sdk-utils`: MCP SDK utilities
- `@metorial/mcp-session`: MCP session management
- `@metorial/sdk`: Main SDK

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/togetherai
Description: Together AI provider integration for Metorial - enables using Metorial tools with Together AI's language models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/togetherai

Together AI provider integration for Metorial - enables using Metorial tools with Together AI's language models through function calling.

## Installation

```bash
npm install @metorial/togetherai
# or
yarn add @metorial/togetherai
# or
pnpm add @metorial/togetherai
# or
bun add @metorial/togetherai
```

## Features

- 🤖 **Together AI Integration**: Full support for Together AI models
- 🛠️ **Function Calling**: Native function calling support
- 📡 **Session Management**: Automatic tool lifecycle handling
- 🔄 **OpenAI Compatibility**: Based on OpenAI-compatible interface
- ⚡ **TypeScript Support**: Full TypeScript support with comprehensive type definitions

## Usage

```typescript
import { metorialTogetherAI } from '@metorial/togetherai';
import { Metorial } from 'metorial';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let togetherai = new OpenAI({
  apiKey: 'your-togetherai-api-key',
  baseURL: 'https://api.together.xyz/v1'
});

await metorial.withProviderSession(
  metorialTogetherAI,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let messages = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    let response = await togetherai.chat.completions.create({
      model: 'mistralai/Mistral-7B-Instruct-v0.2',
      messages,
      tools: session.tools
    });

    let choice = response.choices[0]!;
    let toolCalls = choice.message.tool_calls;

    if (toolCalls && toolCalls.length > 0) {
      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(choice.message.content);
    }
  }
);
```

## Dependencies

- `@metorial/core`: Core Metorial functionality
- `@metorial/mcp-sdk-utils`: MCP SDK utilities
- `@metorial/mcp-session`: MCP session management
- `@metorial/openai-compatible`: OpenAI-compatible base functionality
- `@metorial/sdk`: Main SDK

## Peer Dependencies

This package requires an OpenAI-compatible client for Together AI:

```json
{
  "peerDependencies": {
    "openai": "*"
  }
}
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.
npm package: @metorial/xai
Description: XAI (Grok) provider integration for Metorial - enables using Metorial tools with XAI's Grok models through function calling.
Author: Metorial Inc.
Latest version: 2.1.0

# @metorial/xai

XAI (Grok) provider integration for Metorial - enables using Metorial tools with XAI's Grok models through function calling.

## Installation

```bash
npm install @metorial/xai
# or
yarn add @metorial/xai
# or
pnpm add @metorial/xai
# or
bun add @metorial/xai
```

## Usage

```typescript
import { metorialXAI } from '@metorial/xai';
import { Metorial } from 'metorial';
import OpenAI from 'openai';

let metorial = new Metorial({
  apiKey: 'your-metorial-api-key'
});

let xai = new OpenAI({
  apiKey: 'your-xai-api-key',
  baseURL: 'https://api.x.ai/v1'
});

await metorial.withProviderSession(
  metorialXAI,
  {
    serverDeployments: ['your-server-deployment-id']
  },
  async session => {
    let messages = [
      {
        role: 'user',
        content:
          'Summarize the README.md file of the metorial/websocket-explorer repository on GitHub?'
      }
    ];

    let response = await xai.chat.completions.create({
      model: 'grok-beta',
      messages,
      tools: session.tools
    });

    let choice = response.choices[0]!;
    let toolCalls = choice.message.tool_calls;

    if (toolCalls && toolCalls.length > 0) {
      let toolResponses = await session.callTools(toolCalls);
      console.log('Tool responses:', toolResponses);
    } else {
      console.log(choice.message.content);
    }
  }
);
```

## License

MIT License - see [LICENSE](../../LICENSE) file for details.