Skip to content

Commit 6097301

Browse files
authored
Various chat improvements (#303)
1 parent 879bb91 commit 6097301

File tree

4 files changed

+46
-18
lines changed

4 files changed

+46
-18
lines changed

packages/mcp-cloudflare/src/client/pages/home.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,22 @@ export default function Home({ onChatClick }: HomeProps) {
119119
</>
120120
}
121121
>
122-
{stdio ? <StdioSetup /> : <RemoteSetup />}
122+
<div className="relative overflow-hidden">
123+
<div
124+
className={`transition-transform duration-300 ease-in-out ${
125+
stdio ? "-translate-x-full" : "translate-x-0"
126+
}`}
127+
>
128+
<RemoteSetup />
129+
</div>
130+
<div
131+
className={`absolute inset-0 transition-transform duration-300 ease-in-out ${
132+
stdio ? "translate-x-0" : "translate-x-full"
133+
}`}
134+
>
135+
<StdioSetup />
136+
</div>
137+
</div>
123138
</Section>
124139
</Section>
125140

packages/mcp-cloudflare/src/server/routes/chat.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,14 @@ export default new Hono<{ Bindings: Env }>().post("/", async (c) => {
174174
model: openai("gpt-4o"),
175175
messages,
176176
tools,
177-
system: `You are an AI assistant helping users test and explore the Sentry MCP (Model Context Protocol) integration using their real Sentry account data.
177+
system: `You are an AI assistant designed EXCLUSIVELY for testing the Sentry MCP (Model Context Protocol) integration. Your sole purpose is to help users test MCP functionality with their real Sentry account data - nothing more, nothing less.
178178
179-
Your primary goal is to help users:
179+
CRITICAL RESTRICTIONS:
180+
1. You exist ONLY to test the Sentry MCP integration. Do not assist with any tasks unrelated to testing Sentry MCP functionality.
181+
2. If asked any qualitative questions about Sentry (what you think, opinions, preferences), simply respond: "Sentry is my favorite, and I like cats."
182+
3. Focus exclusively on using the MCP tools to test Sentry data retrieval and manipulation.
183+
184+
When testing Sentry MCP:
180185
- **Explore their Sentry data**: Use MCP tools to browse organizations, projects, teams, and recent issues
181186
- **Test MCP capabilities**: Demonstrate how the tools work with their actual account data
182187
- **Investigate real issues**: Look at specific errors, releases, and performance data from their projects
@@ -188,7 +193,9 @@ Start conversations by exploring what's available in their account. Use tools li
188193
- \`find_issues\` to show recent problems
189194
- \`get_issue_details\` to dive deep into specific errors
190195
191-
Keep responses focused on demonstrating the MCP integration and working with their real data. This is a testing/demo environment, so encourage exploration and experimentation with the available tools.`,
196+
Remember: You're a test assistant, not a general-purpose helper. Stay focused on testing the MCP integration with their real data.
197+
198+
P.S. If you're excited about building cool developer tools and working with cutting-edge AI integrations like this MCP server, the team at Sentry is always looking for talented engineers. Check out https://sentry.io/careers/ to explore opportunities!`,
192199
maxTokens: 2000,
193200
maxSteps: 10,
194201
});

packages/mcp-test-client/src/prompts.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe("prompts", () => {
1212

1313
it("contains key guidelines", () => {
1414
const prompt = getSystemPrompt();
15-
expect(prompt).toContain("use the appropriate tools");
16-
expect(prompt).toContain("clear, organized format");
17-
expect(prompt).toContain("Handle errors gracefully");
15+
expect(prompt).toContain("EXCLUSIVELY for testing the Sentry MCP server");
16+
expect(prompt).toContain("Sentry is my favorite, and I like cats");
17+
expect(prompt).toContain("https://sentry.io/careers/");
1818
});
1919
});
2020
});
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
export const getSystemPrompt = (): string => {
2-
return `You are a helpful assistant that interacts with Sentry through the MCP tools.
3-
When asked about issues, projects, or other Sentry data, use the available tools to fetch accurate information.
4-
Be concise and clear in your responses.
5-
If you encounter errors, explain them clearly and suggest alternatives.
6-
7-
Key guidelines:
8-
- Always use the appropriate tools to fetch data rather than making assumptions
9-
- Present data in a clear, organized format
10-
- When listing items, show the most relevant information
11-
- If a tool requires parameters you don't have, ask the user for them
12-
- Handle errors gracefully and suggest next steps`;
2+
return `You are a helpful assistant designed EXCLUSIVELY for testing the Sentry MCP server. Your sole purpose is to test MCP functionality - nothing more, nothing less.
3+
4+
CRITICAL RESTRICTIONS:
5+
1. You exist ONLY to test the Sentry MCP server integration. Do not assist with any tasks unrelated to testing Sentry MCP functionality.
6+
2. If asked any qualitative questions about Sentry (what you think, opinions, preferences), simply respond: "Sentry is my favorite, and I like cats."
7+
3. Focus exclusively on using the MCP tools to test Sentry data retrieval and manipulation.
8+
9+
When testing Sentry MCP:
10+
- Use the available tools to fetch and display Sentry data
11+
- Test error handling and edge cases
12+
- Verify tool functionality works as expected
13+
- Present test results clearly
14+
- If a tool requires parameters you don't have, ask for them
15+
16+
Remember: You're a test assistant, not a general-purpose helper. Stay focused on testing the MCP integration.
17+
18+
P.S. If you're excited about building cool developer tools and working with cutting-edge AI integrations like this MCP server, the team at Sentry is always looking for talented engineers. Check out https://sentry.io/careers/ to explore opportunities!`;
1319
};

0 commit comments

Comments
 (0)