About mcp
mcp is an MCP server published by git+prompt-template in the AI category: model Context Protocol @prompt-template adapter.
Install
npx @prompt-template/mcpclaude mcp add prompt-template -- npx -y @prompt-template/mcpnpx -y @prompt-template/mcpThis 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 mcp
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
4 checks have not been run yet.
README
@prompt-template
Monorepo for the core @prompt-template modules, types, and adapters.
Quick start
npm i @prompt-template/core
import { PromptTemplate } from '@prompt-template/core'
const promptTemplate = PromptTemplate.create`
Brainstorm 3 names for a superhero ${'animal'}.
`
const prompt = promptTemplate.format({
animal: 'cat',
})
//=> 'Brainstorm 3 names for a superhero cat.'
For detailed usage and API documentation, please refer to the README in packages/core.
With OpenAI
npm i @prompt-template/core @prompt-template/openai openai
import { PromptTemplate } from '@prompt-template/core'
import { ChatPromptTemplate } from '@prompt-template/openai'
import { OpenAI } from 'openai'
const chatPromptTemplate = ChatPromptTemplate.from([
{
role: 'system',
content: 'You are a friendly assistant.',
},
{
role: 'user',
promptTemplate: PromptTemplate.create`
Brainstorm 3 names for a superhero ${'animal'}.
`,
},
])
const messages = chatPromptTemplate.format({
animal: 'cat',
})
//=> [
// { role: 'system', content: 'You are a friendly assistant.' },
// { role: 'user', content: 'Brainstorm 3 names for a superhero cat.' }
// ]
const openai = new OpenAI()
const completion = await openai.chat.completions.create({
model: 'gpt-4o-mini',
messages,
})
console.log(completion.choices[0]?.message.content)
For detailed usage and API documentation, please refer to the README in packages/openai.
With AI SDK
npm i @prompt-template/core @prompt-template/ai-sdk @ai-sdk/openai ai
import { PromptTemplate } from '@prompt-template/core'
import { ChatPromptTemplate } from '@prompt-template/ai-sdk'
import { openai } from '@ai-sdk/openai'
import { generateText } from 'ai'
const chatPromptTemplate = ChatPromptTemplate.from([
{
role: 'system',
content: 'You are a friendly assistant.',
},
{
role: 'user',
promptTemplate: PromptTemplate.create`
Brainstorm 3 names for a superhero ${'animal'}.
`,
},
])
const messages = chatPromptTemplate.format({
animal: 'cat',
})
//=> [
// { role: 'system', content: 'You are a friendly assistant.' },
// { role: 'user', content: 'Brainstorm 3 names for a superhero cat.' }
// ]
const completion = await generateText(openai, {
model: openai('gpt-4o-mini'),
messages,
})
console.log(completion.text)
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.