1. Conduid
  2. AI
  3. Execution Sampling
MCP server · AI

Execution Sampling

MCP sampling provider for AI generation - no API keys needed

37Low

Scored 6 months ago · breakdown

About Execution Sampling

Execution Sampling is an MCP server in the AI category: mCP sampling provider for AI generation - no API keys needed.

Install

Claude Code
claude mcp add execution-sampling -- npx -y @kjerneverk/execution-sampling
npx
npx -y @kjerneverk/execution-sampling

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Execution Sampling

Powered by Claude · Grounded in docs

I know everything about Execution Sampling. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

@kjerneverk/execution-sampling

MCP sampling provider for AI generation - no API keys needed!

Overview

execution-sampling is a provider implementation that uses MCP (Model Context Protocol) sampling to delegate AI generation to the calling client. This eliminates the need for duplicate API keys when your tool is used via MCP in IDEs like Cursor, GitHub Copilot, or other MCP-enabled environments.

Key Benefits:

  • No server-side API keys required
  • Seamless integration with MCP clients
  • Drop-in replacement for direct providers
  • Implements standard Provider interface
  • Automatic capability detection

Installation

npm install @kjerneverk/execution-sampling

Quick Start

import { createSamplingProvider } from '@kjerneverk/execution-sampling';

// Create provider with session context
const provider = createSamplingProvider({
  sessionId: 'session-123',
  clientName: 'Cursor',
  supportsTools: false,
});

// Use like any other provider
const response = await provider.execute({
  model: 'claude-sonnet-4-5',
  messages: [
    { role: 'user', content: 'Generate a plan for...' }
  ],
  responseFormat: { type: 'json_schema', /* ... */ }
});

How It Works

  1. Your MCP server detects the client supports sampling
  2. Instead of using direct API calls, you create a SamplingProvider
  3. When execute() is called, it sends a sampling/createMessage request to the client
  4. The client (Cursor, Copilot, etc.) generates the response using its AI
  5. The response is returned to your server

No duplicate API keys needed!

Requirements

  • Client must support MCP sampling capability
  • Client must have AI/LLM access
  • MCP SDK version 1.0.4 or higher

API Reference

See full API documentation in docs/api.md

Error Handling

The provider handles common sampling errors:

  • User rejection (-1)
  • Invalid parameters (-32602)
  • Timeouts
  • Unsupported capabilities

See docs/error-handling.md for details.

Examples

See examples/ directory for complete usage examples.

License

Apache-2.0

Part of @kjerneverk Ecosystem

This package is part of the @kjerneverk ecosystem of execution providers and AI tools.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Execution Sampling

How do I install Execution Sampling?

Run claude mcp add execution-sampling -- npx -y @kjerneverk/execution-sampling, then add the server to your MCP client's configuration.

Is Execution Sampling safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Execution Sampling still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.