Skip to content

Conversation

ashwin-ant
Copy link
Member

Depends on modelcontextprotocol/typescript-sdk#20, based on #17.

CleanShot.2024-10-16.at.16.31.30.mp4

@ashwin-ant ashwin-ant changed the title Ashwin/progress Visualize progress notifications Oct 16, 2024
Comment on lines -2 to -5
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird default CSS that was causing the window to look weird at large sizes

Comment on lines +32 to +109
<div className="w-64 bg-white shadow-md p-4 overflow-hidden flex flex-col h-full">
<div className="flex-1 overflow-y-auto mb-4 border-b pb-4">
<h2 className="text-lg font-semibold mb-4">History</h2>
{requestHistory.length === 0 ? (
<p className="text-sm text-gray-500 italic">No history yet</p>
) : (
<ul className="space-y-3">
{requestHistory
.slice()
.reverse()
.map((request, index) => (
<li
key={index}
className="text-sm text-gray-600 bg-gray-100 p-2 rounded"
>
<div
className="flex justify-between items-center cursor-pointer"
onClick={() =>
toggleRequestExpansion(requestHistory.length - 1 - index)
}
>
<span className="font-mono">
{requestHistory.length - index}.{" "}
{JSON.parse(request.request).method}
</span>
<span>
{expandedRequests[requestHistory.length - 1 - index]
? "▼"
: "▶"}
</span>
</div>
{expandedRequests[requestHistory.length - 1 - index] && (
<>
<div className="mt-2">
<div className="flex justify-between items-center mb-1">
<span className="font-semibold text-blue-600">
Request:
</span>
<button
onClick={() => copyToClipboard(request.request)}
className="text-blue-500 hover:text-blue-700"
>
<Copy size={16} />
</button>
</div>
<pre className="whitespace-pre-wrap break-words bg-blue-50 p-2 rounded">
{JSON.stringify(JSON.parse(request.request), null, 2)}
</pre>
</div>
{request.response && (
<div className="mt-2">
<div className="flex justify-between items-center mb-1">
<span className="font-semibold text-green-600">
Response:
</span>
<button
onClick={() => copyToClipboard(request.response!)}
className="text-blue-500 hover:text-blue-700"
>
<Copy size={16} />
</button>
</div>
<pre className="whitespace-pre-wrap break-words bg-green-50 p-2 rounded">
{JSON.stringify(
JSON.parse(request.response),
null,
2,
)}
</pre>
</div>
)}
</>
)}
</li>
))}
</ul>
)}
</div>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The joy of Tailwind 🤮 Nothing has changed here, just some light touch-ups to make the History list only take up the top half of the right sidebar.

<>
<span className="flex-1">{tool.name}</span>
<span className="text-sm text-gray-500">{tool.description}</span>
<span className="text-sm text-gray-500 text-right">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right-aligning the description text because it looks better

package.json Outdated
"start": "concurrently \"yarn start-server\" \"yarn start-client\"",
"prettier-fix": "prettier --write .",
"update:mcp": "git subtree pull --prefix=packages/mcp-typescript https://github.com/modelcontextprotocol/typescript-sdk.git main --squash"
"update:mcp": "git subtree pull --prefix=packages/mcp-typescript https://github.com/modelcontextprotocol/typescript-sdk.git ashwin/progress --squash"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will undo this once modelcontextprotocol/typescript-sdk#20 is in

Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-gun-cool

Base automatically changed from ashwin/updatesdk to main October 17, 2024 15:02
7d70db8 Merge pull request #20 from modelcontextprotocol/ashwin/progress
65a8613 fix schema definitions for RequestSchema

git-subtree-dir: packages/mcp-typescript
git-subtree-split: 7d70db805740c53f21153d72be6f34d70818a9da
@ashwin-ant ashwin-ant merged commit 5f9d11b into main Oct 17, 2024
@ashwin-ant ashwin-ant deleted the ashwin/progress branch October 17, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants