import { useQuery, useMutation } from "convex/react";
import { api } from "../convex/_generated/api";
export default function App() {
// Watch the results of the Convex function `getCounter`.
const counter = useQuery(api.getCounter) ?? 0;
const increment = useMutation(api.incrementCounter);
function incrementCounter() {
// Execute the Convex function `incrementCounter` as a mutation
// that updates the counter value.
return increment({ increment: 1 });
}
return (
<main>
<div>Here's the counter:</div>
<div>{counter}</div>
<button onClick={incrementCounter}>Add One!</button>
</main>
);
}
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'
If you have feedback or need assistance with the MCP directory API, please join our Discord server