🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@promptlab/mcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptlab/mcp - npm Package Compare versions

Comparing version
1.0.4
to
1.1.0
+96
-71
dist/cli.js

@@ -26,3 +26,7 @@ #!/usr/bin/env node

});
server.tool('listExperiments', 'Retrieve all experiments associated with the user account', {}, async () => {
server.resource('experiments', 'promptlab://experiments', {
name: 'List of all experiments',
description: 'List of all experiments associated with the user account',
mimeType: 'application/json'
}, async () => {
try {

@@ -39,8 +43,7 @@ const experiments = await fetch(new URL('experiments', getUrl()), {

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: 'promptlab://experiments',
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -81,6 +84,13 @@ }

});
server.tool('getExperimentDetails', 'Fetch detailed information about a specific experiment by ID. Use this when you need comprehensive experiment data for updates or analysis.', {
experimentId: z.string().describe('ID of the experiment to get')
}, async ({ experimentId }) => {
server.resource('experiment-details', 'promptlab://experiment/{experimentId}', {
name: 'Experiment details',
description: 'Detailed information about a specific experiment',
mimeType: 'application/json'
}, async (uri) => {
try {
const url = new URL(uri.toString());
const experimentId = url.pathname.split('/').pop();
if (!experimentId) {
throw new Error('Missing experiment ID in URI');
}
const response = await fetch(new URL(`experiments/${experimentId}`, getUrl()), {

@@ -96,8 +106,7 @@ headers: {

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: uri.toString(),
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -170,25 +179,21 @@ }

});
server.tool('getUserModels', 'Retrieve all available models for the user based on their credits and API keys', {
limit: z
.number()
.default(50)
.describe('Maximum number of models to return'),
offset: z
.number()
.default(0)
.describe('Number of models to skip for pagination'),
searchQuery: z
.string()
.optional()
.describe('Optional search query to filter models')
}, async ({ limit, offset, searchQuery }) => {
server.resource('models', 'promptlab://models', {
name: 'Available models',
description: 'Available models for the user based on their credits and API keys',
mimeType: 'application/json'
}, async (uri) => {
try {
const params = new URLSearchParams({
limit: limit.toString(),
offset: offset.toString()
const url = new URL(uri.toString());
const params = new URLSearchParams(url.search);
const limit = params.get('limit') || '50';
const offset = params.get('offset') || '0';
const searchQuery = params.get('searchQuery');
const searchParams = new URLSearchParams({
limit,
offset
});
if (searchQuery) {
params.append('searchQuery', searchQuery);
searchParams.append('searchQuery', searchQuery);
}
const response = await fetch(new URL(`models?${params}`, getUrl()), {
const response = await fetch(new URL(`models?${searchParams}`, getUrl()), {
headers: {

@@ -203,8 +208,7 @@ Authorization: secret

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: uri.toString(),
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -216,6 +220,14 @@ }

});
server.tool('getExperimentModels', 'Get the models configured for a specific experiment', {
experimentId: z.string().describe('ID of the experiment')
}, async ({ experimentId }) => {
server.resource('experiment-models', 'promptlab://experiment/{experimentId}/models', {
name: 'Experiment models',
description: 'Models configured for a specific experiment',
mimeType: 'application/json'
}, async (uri) => {
try {
const url = new URL(uri.toString());
const pathParts = url.pathname.split('/');
const experimentId = pathParts[pathParts.length - 2];
if (!experimentId) {
throw new Error('Missing experiment ID in URI');
}
const response = await fetch(new URL(`experiments/${experimentId}/models`, getUrl()), {

@@ -231,8 +243,7 @@ headers: {

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: uri.toString(),
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -563,8 +574,16 @@ }

});
server.tool('getBlock', 'Get a block with all its variants from an experiment', {
experimentId: z.string().describe('ID of the experiment'),
messageId: z.string().describe('ID of the message containing the block'),
blockId: z.string().describe('ID of the block to get')
}, async ({ experimentId, messageId, blockId }) => {
server.resource('block-details', 'promptlab://experiment/{experimentId}/message/{messageId}/block/{blockId}', {
name: 'Block details',
description: 'Block with all its variants from an experiment',
mimeType: 'application/json'
}, async (uri) => {
try {
const url = new URL(uri.toString());
const pathParts = url.pathname.split('/');
const experimentId = pathParts[2];
const messageId = pathParts[4];
const blockId = pathParts[6];
if (!experimentId || !messageId || !blockId) {
throw new Error('Missing experimentId, messageId, or blockId in URI');
}
const response = await fetch(new URL(`experiments/${experimentId}/messages/${messageId}/blocks/${blockId}`, getUrl()), {

@@ -580,8 +599,7 @@ headers: {

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: uri.toString(),
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -593,7 +611,15 @@ }

});
server.tool('getMessage', 'Get a message with all its blocks and variants from an experiment', {
experimentId: z.string().describe('ID of the experiment'),
messageId: z.string().describe('ID of the message to get')
}, async ({ experimentId, messageId }) => {
server.resource('message-details', 'promptlab://experiment/{experimentId}/message/{messageId}', {
name: 'Message details',
description: 'Message with all its blocks and variants from an experiment',
mimeType: 'application/json'
}, async (uri) => {
try {
const url = new URL(uri.toString());
const pathParts = url.pathname.split('/');
const experimentId = pathParts[2];
const messageId = pathParts[4];
if (!experimentId || !messageId) {
throw new Error('Missing experimentId or messageId in URI');
}
const response = await fetch(new URL(`experiments/${experimentId}/messages/${messageId}`, getUrl()), {

@@ -609,8 +635,7 @@ headers: {

return {
content: [
{
type: 'text',
text: JSON.stringify(data, null, 2)
}
]
contents: [{
uri: uri.toString(),
text: JSON.stringify(data, null, 2),
mimeType: 'application/json'
}]
};

@@ -617,0 +642,0 @@ }

{
"name": "@promptlab/mcp",
"version": "1.0.4",
"version": "1.1.0",
"description": "Model Context Protocol server for PromptLab experiments",

@@ -11,4 +11,3 @@ "main": "dist/index.js",

"scripts": {
"build": "tsx build.ts",
"dev": "tsx src/index.ts"
"build": "tsx build.ts"
},

@@ -15,0 +14,0 @@ "keywords": [